I have some custom renderers, “CustomMaterialLabelRenderer”, “CustomMaterialListWithDetailRenderer”, there are copies of the OOTB renderers for example:
export const CustomMaterialHorizontalLayoutRenderer = ({
uischema,
renderers,
cells,
schema,
path,
enabled,
visible,
config
}: LayoutProps) => {
const layout = uischema as HorizontalLayout;
const childProps: MaterialLayoutRendererProps = {
elements: layout.elements,
schema,
path,
enabled,
direction: 'row',
visible,
renderers: renderers,
cells: cells
};
const appliedUiSchemaOptions = merge({}, config, uischema.options);
const paddingTop = appliedUiSchemaOptions.paddingTop as ResponsiveStyleValue<React.CSSProperties["paddingTop"]> || undefined;
const paddingRight = appliedUiSchemaOptions.paddingRight as ResponsiveStyleValue<React.CSSProperties["paddingRight"]> || undefined;
const paddingBottom = appliedUiSchemaOptions.paddingBottom as ResponsiveStyleValue<React.CSSProperties["paddingBottom"]> || undefined;
const paddingLeft = appliedUiSchemaOptions.paddingLeft as ResponsiveStyleValue<React.CSSProperties["paddingLeft"]> || undefined;
const divider = appliedUiSchemaOptions.divider as boolean || undefined;
return (
<>
<Box sx={{
pt: { paddingTop }, pr: { paddingRight }, pb: { paddingBottom }, pl: { paddingLeft }
}}>
<MaterialLayoutRenderer
{...childProps}
visible={true}
/>
</Box>
{divider === true && <Divider sx={{ mt:2 }} />}
</>
);
};
export default withJsonFormsLayoutProps(CustomMaterialHorizontalLayoutRenderer);
But the “visible” prop is undefined (hard coded to true in my example).
The same for “CustomMaterialListWithDetailRenderer”, but other props have the issue such as the “required” prop. Am I missing something really obvious here? Should these out of the box props have values passed to them via withJsonFormsLayoutProps and withJsonFormsArrayLayoutProps respectively?