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

Add react ref and key props to components #37

Merged
merged 2 commits into from
Aug 20, 2020

Conversation

Freddy03h
Copy link
Member

  • Add ref prop to NavigationContainer (important for universal link scenario)
  • Add key prop to components

Copy link
Member

@MoOx MoOx left a 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=?,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one seems unecessary

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Freddy03h
Copy link
Member Author

The doc say the ppx add the key but not the ref : https://reasonml.github.io/reason-react/docs/en/components#reactcomponent

@Freddy03h
Copy link
Member Author

I added key only for components made with makeProps

@MoOx
Copy link
Member

MoOx commented Aug 20, 2020

Oh that's right, I read too quickly!

@MoOx MoOx merged commit fd92f63 into rescript-react-native:master Aug 20, 2020
@MoOx
Copy link
Member

MoOx commented Aug 20, 2020

5.0.1 is out :)

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