Overview of Reagent component forms
masterReagent components are built around a mandatory render function that transforms data into Hiccup (HTML data structures). There are three primary ways to define a component, increasing in complexity:
- Form-1 (Simple Function): A direct function where data is passed as parameters and the return value is the Hiccup HTML.
- Form-2 (Function returning a Function): An outer function used for setup/state initialization that returns an inner render function. This allows the renderer to close over local state.
- Form-3 (Map of functions): A map containing a
renderfunction and optionalReact lifecyclemethods for advanced interventions.