Reactive Components
component() with Reactive component definition
Takes a function accepting props type P (reactive props) which is deeply unboxed, returning a function that returns a ReactElement or null.
Example
Lifecycles
onMounted()
Called when the component is mounted. Accepts a handler function which returns either void or a Disposer function. Disposer function is called when component is unmounted.
onUnmounted()
Called when the component is unmounted. Accepts a handler function that returns void
Context API
consumeContext()
component.withHandle()
Same as forwardRef. Ref prop will be passed to component alongside with props.
imperativeHandle()
Used to define the content of the forwarded Ref. Similar to useImperativeHandle. Takes two parameters. First is the ref to populate second is the object to set the ref value.
component() with functional component
A higher order component which accepts functional component and produces a component that reacts to reactive data.
ReactiveBoundary
Built-in component receiving a render function as children. Used to make some piece of rendered nodes reactive without extracting it as a component. It has an optional "data" property to be passed to the render function.
Last updated