pub fn user_defined_render_fn(
def: &ComponentDef,
data: &ComponentDataModel,
component_map: &ComponentMap,
) -> ResultStyledDomRenderDomErrorExpand description
Default render function for user-defined (JSON-imported) components.
Interprets the ComponentDef structure generically:
- Creates a wrapper
<div>with the component’s CSS class - For each data field, renders content based on type:
- String fields → text node with current value
- Bool fields → conditional display
- StyledDom fields → embeds the child DOM subtree
- StructRef/EnumRef → recursively renders sub-components if found in ComponentMap
- Other scalar fields → text display of the value
- Applies the component’s scoped CSS