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

Fix forwardRef unsafety + make DOM refs types more idiomatic #19

Merged
merged 1 commit into from
Jun 2, 2019

Conversation

jchavarri
Copy link
Collaborator

Fixes #13.

This PR:

  • Fixes Ref.t functions current and setCurrent which were pointing to nonexistent ReactJS functions
  • Makes DOM refs types more idiomatic by being option, not Js.opt
  • Defines forwardRef ref to be of type ReactDOM.domRef to avoid unsafety issues
  • Updates the ppx so forwardRef usages get the right signature for ref including ReactDOM.domRef
  • Moves forwardRef to ReactDOM module to avoid circular dependencies problems
  • Adds a new ppx test for forwardRef processing

@jchavarri jchavarri merged commit f5f74b6 into master Jun 2, 2019
@jchavarri jchavarri deleted the improve-forwardref branch June 2, 2019 11:28
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.

Revisit forwardRef
1 participant