How to correctly gather Editor type with Extension recognition #6250
Replies: 1 comment
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am working on a project where I'm using the editor in a lot of place's with a few different variations which have different controls.
I started making a common component which all of these can use so it's just a matter of providing a flag of what will controls will be enabled.
Something along the lines of this:
I have a wrapper component which initialises the Editor
The MenuBar component iterates through all the available options provided and will show a button to control the tiptap editor. The MenuBar uses the useCurrentEditor hook to access the Editor.
I have some mapping data (EditorOptions shown below) which maps to some of the button data and what to run in the tiptap editor and passes the editor which it is to be run against, it looks something like this with a lot more options
Only issue is, that for the extensions, I get this type error and cannot figure out how to get the type for the Editor which has the information about the available extensions
My question's are:
Beta Was this translation helpful? Give feedback.
All reactions