Hello,
I am working on a content Action opening a modal. Everything works fine, but when the modal is closed I get the following error in the console:
react-dom.profiling.min.js:205 TypeError: Cannot read properties of undefined (reading 'type')
at bn (RendererNextComponent.tsx:204:50)
which in turn links to
const isFirstChildAForm = forgeDoc.children[0].type === 'Form';
This prevents the action menu from opening again, i.e. if you click on it, it opens and immediately closes.
Any idea?
<Modal onClose={close}>
<Form onSubmit={handleSubmit(submit)}>
<ModalHeader title="Create Page">
<ModalTitle>Create Page</ModalTitle>
</ModalHeader>
<ModalBody>
<Text>Create Pagee</Text>
<Label>
Select
<RequiredAsterisk />
</Label>
<Select
isRequired="true"
name="page"
options={pageListSelect ? pageListSelect : "loading..."}
{...register("select")}
/>
<Label>
Name of the new page
<RequiredAsterisk />
</Label>
<Textfield
{...register("pagename", {
required: true,
defaultValue: "New Page",
})}
/>
</ModalBody>
<ModalFooter>
<Text>
Create a new child Page
</Text>
<Button onClick={close} appearance="subtle" type="button">
Cancel
</Button>
<Button appearance="primary" type="submit">
Submit
</Button>
</ModalFooter>
</Form>
</Modal>