How to integrate custom leaf to slate editor? I have tried the one below
leaves: [
'bold',
'italic',
{
name: Leaf.name,
Button: Leaf.Button,
Leaf: Leaf.Leaf,
},
],
but it throws
Uncaught Error: The
useSlate
hook must be used inside the <Slate> component's context.
at useSlate (index.es.js:1659:1)
at Button (colorText.tsx:69:26)
are you using the LeafButton provided by Payload? What does that code look like
so you need a single version of slate, just importing from payload/node_modules/slate will work
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.