sstur / react-rte

Pure React rich text WYSIWYG editor based on draft-js.
https://react-rte.org
ISC License
2.87k stars 431 forks source link

Allow RichTextEditor to forwardRef #412

Closed kendallgassner closed 2 years ago

kendallgassner commented 3 years ago

Issue: https://github.com/sstur/react-rte/issues/403

I want to use React-hook-form with react-rte but need to be able to forwardRef

the-serious-programmer commented 3 years ago

https://github.com/sstur/react-rte/issues/403#issuecomment-910314605 maybe this can help you out, good luck!

sstur commented 2 years ago

I'm closing this for now because:

  1. Using createRef and forwardRef requires React v16.3.0 or newer which will require updating the peer dependencies, which is a breaking change that I'm not ready to make at this moment (see below)
  2. In order to get the tests passing, this will also require bumping Flow to v0.89.0 or newer to support createRef and forwardRef. Updating Flow surfaces a ton of new type errors and does not seem to be compatible with the version of draft-js this project is using

I'm not opposed to doing #1 above and bumping our major version since it's breaking, but I am opposed to #2 since I want to migrate away from Flow and to TypeScript instead (which will probably be less work than updating the Flow version). After we migrate to TypeScript, then I'll bump React and then we can tackle this forwardRef issue. I don't have an ETA on any of that, but I'm not planning to do a bunch of work updating Flow to get this relatively minor forwardRef feature working.