Currently, when I try to set a custom elements or leaves in the richText, I get
Cannot find a descendant at path
error which causes because useMemo is reevaluated on reloads so we might need to use useState instead?
Related issue:
https://github.com/ianstormtaylor/slate/issues/4081any thoughts?
This is probably due to your implementation, and you might be attempting to use an improper path or location
that error is common when you try to update a node's properties (or similar) but the path that you're trying to do that against is not valid
we do this often within Slate, all over the place in fact - so it's not something that is related to our use of
useMemo
vs.
useState
hmm, all i wanted to do is overriding the elements in the richText so thats what i did
<RichText name="test" label="Test" admin={{elements:['h1', 'h2']}}/>
then i got the error i mentioned but worked fine after i replaced useMemo with useState
Star
Discord
online
Get dedicated engineering support directly from the Payload team.