Skip to content
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

✨ Follow Ref on ForwardRef component in reactRenderer #1690

Merged

Conversation

castroCrea
Copy link
Contributor

  • Allow us to pass Ref to a function ForwardRef component in reactRenderer (useful for mention)

@philippkuehn
Copy link
Contributor

Hey @castroCrea, can you please explain to me what this is helpful for?

@castroCrea
Copy link
Contributor Author

It is helpful if we use functional component React.forwardRef instead of class component.

For example, in Mention, you pass onKepPress to the ref but it only works for Class component. Will be nice for this to work with functional component also.

@philippkuehn
Copy link
Contributor

Ah great! So this would be a fix for #1040?

Since I don’t really have experience with forwardRef: What would a functional component have to look like to be able to call onKeyDown from outside there as well?

@castroCrea
Copy link
Contributor Author

Yes exactly

@philippkuehn philippkuehn merged commit d1f2ad2 into ueberdosis:main Sep 7, 2021
@philippkuehn
Copy link
Contributor

Perfect! Thanks!

@philippkuehn
Copy link
Contributor

The mentions demo is now using a functional component 🎉

andrewlu0 pushed a commit to trybaseplate/tiptap that referenced this pull request Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants