Render Properties
Components like data connectors or state systems often pass render properties down to their children so that other components can bind to these values in their own properties.
To craft your own components that pass down data as render properties, there are two steps that need to be taken.
Setting the control to be a function
Children as a control type can be modified to be a render function. This is done by opening the context menu to the property which is using the children control type and selecting "Edit Control", followed by checking the "render function" option that appears.
Calling children
as a function when it's used.
children
as a function when it's used.Once the property is a function, it is important to edit the definition to change the usage of that property to a function call. This function can be called with an argument that will be passed as a render property down to its children.
Updated 5 months ago