-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
Add react ref and key props to components #37
Conversation
Freddy03h
commented
Aug 17, 2020
- Add ref prop to NavigationContainer (important for universal link scenario)
- Add key prop to components
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's weird. We should not have to define key, they should be automatic with the jsx ppx...
But I made a test & the compiler is yelling indeed.
We should only add the ref when we create the makeProps by hand and not when we have [@react.component]
(= ppx, so auto ref)
@@ -99,6 +99,7 @@ module NavigationContainer = { | |||
[@bs.module "@react-navigation/native"] [@react.component] | |||
external make: | |||
( | |||
~ref: ReactNative.NativeElement.ref=?, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one seems unecessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't work without it, and I looked on other project to do it : https://github.com/reason-react-native/datetimepicker/blob/f479766c79ce24248c8752c2b1a6e5edb35bb2b1/src/ReactNativeDateTimePicker.re#L21
The doc say the ppx add the |
I added |
Oh that's right, I read too quickly! |
5.0.1 is out :) |