useComposition Hook
useComposition Hook
This is a custom hook developed by Clutch, it is used to return the render from your component's composition.
When creating a new component, the default definition simply returns the result of calling useComposition()
. This allows users to rely fully on the visual builder to craft their component. The props passed to useComposition
will become available as render props to the user's composition.


The call to useComposition
can take arbitrary data, allowing anything to be available via renderProps
.


In this example, a key-value pair of "text" and "Hello World" was added to the renderprops
passed to the composition.
Updated 6 months ago
Did this page help you?