-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ReactRenderer for React.FunctionComponent with ref #1040
Comments
Hey, I have to admit that I have limited experience with React. I haven’t found a way to communicate from the suggestion extension with a function component, so currently it's only possible with a class component. Maybe it’s an option to use a class component just to communicate with your functional component? But I also have to admit that I don’t find the current solution optimal and I’m open to improvements! |
how do I fix this or maybe making an extension of ReactRenderer would be easier |
Need better react support! |
always happy for some react contributions! |
functional components are now supported. I also migrated the mention demo. source: https://github.com/ueberdosis/tiptap/blob/b95507797d2fbf9147396de7f753e45e83736687/demos/src/Examples/Community/React/MentionList.jsx |
Is your feature request related to a problem? Please describe.
I couldn't find a way to run a method from the function component, which is wrapped into
RectRenderer
. From what I can seeRectRenderer
pass a ref as a prop only for class componentsDescribe the solution you’d like
A way to be able to run methods from the function components wrapped into
ReactRenderer
.Example:
For the Mention extension
import Mention from "@tiptap/extension-mention";
I'd like to be able to configure it with my ownMentionList
component.MentionList
is a function component withforwardRef
anduseImperativeHandle
hook.then I'd expect to able to call
reactRenderer.ref?.current.onKeyDown(props)
inonKeyDown(props)
ofMention.configure
undersuggestion
key.Please let me know if there's already a way to make it work with function components, that I'm not aware of! If not, would love to hear your thoughts on the suggested approach.
The text was updated successfully, but these errors were encountered: