useParent
Get the useParent hook from the package.
Setup โ๏ธ#
You can generate a parent instance to use the send method within a function component. You must set the ref in the DOM element which is the direct parent of the children which can be transferred.
Usage ๐#
Let's define a very simple child component for the example.
We use two <Parent> components in the app as defined above.
Now we can reparent anywhere in our app using the send method.
Example ๐ก#
Work in progress.