-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Hi Sacha,
I think I've stumbled upon a bug in the rje-code-widgets, which is caused by the new destroy() feature in the HeadlessEditor introduced in v0.36.
In the useEditor hook we call the HeadlessEditor.destroy() function, which, among other things, sets the instance variable HeadlessEditor::draft to null.
In the rje-code-widgets package, however, we access editor.draft.config in the jsonSchemaLinter() function, for example.
I assume that we're getting a Cannot read properties of null (reading 'config') because the hook (useEffect) and the rendering of the widget run asynchronously in the render loop and the rendering of the widget is obviously still accessing an editor instance that has already been destroyed.
Can you confirm this line of thought?