Wrapping a CodeNode with a React Component #5296
Replies: 1 comment 9 replies
-
What about directly write your React wrapper in the |
Beta Was this translation helpful? Give feedback.
9 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've been working on adding a toolbar on every code block. I've looked at the code on the playground, where you listen to mouseover and position the "code actions menu" absolutely based on the code blocks coordinates. For my use case, it would be better if I could insert a React component that surrounds every code block.
I tried creating a custom node by extending CodeNode and overriding its
createDom
method, but I was unable to figure a workaround for inserting a react component.Is it possible to do something similar to a DecoratorNode on a CodeNode or are there any workarounds besides hacking it together with absolute positioning?
Beta Was this translation helpful? Give feedback.
All reactions