I am trying to attach additional functionality on to when a user adds an item to an array (in a custom renderer). Right now the following does nothing and also stops me being able to add items to the array. I am obviously misunderstanding how to do this, what is the correct approach? Thanks.
import { and, rankWith, scopeEndsWith } from "@jsonforms/core";
import { Unwrapped } from "@jsonforms/material-renderers";
import { withJsonFormsArrayLayoutProps } from "@jsonforms/react";
const { MaterialArrayLayout } = Unwrapped;
export const ArrayWithIdControl = (props) => {
const customProps = {...props}
return (
<MaterialArrayLayout {...customProps} addItem={() => console.log("Hello world")} />
)
}
export const arrayWithIdControlTester = rankWith(
5,
scopeEndsWith('rooms')
);
export default withJsonFormsArrayLayoutProps(ArrayWithIdControl);