UNPKG

fluidstate-preact

Version:

Library for using fine-grained reactivity state management library fluidstate in Preact

12 lines (11 loc) 608 B
import { FunctionComponent } from "preact"; /** * A Higher-Order Component (HOC) that makes a Preact component reactive. * The wrapped component will automatically re-render whenever any `fluidstate` * reactive properties accessed during its render cycle change. * * @template P The props type of the component to wrap. * @param {FunctionComponent<P>} Component The Preact functional component to make reactive. * @returns {FunctionComponent<P>} A new reactive component that wraps the original one. */ export declare const withReactive: <P>(Component: FunctionComponent<P>) => FunctionComponent<P>;