foolswisdom
Child component cannot access context that the parent can access?
I have a file like this:
As you can see, the
RichTextPlugin
component renders the Placeholder
component. Except that I get an error:
... which is the error thrown by useLexicalComposerContext
when the context is empty.
Now, the useLexicalComposerContext
is called in the parent component as well, and it returns the editor successfully, no errors (I added logs to double check as well). So why is the child unable to access it?
I also added some getOwner
logs (not shown), and they show the parent as having an owner, but that the owner of the child is null
.
I'm quite frustrated, if anyone has an idea, please help!12 replies