Skip to content

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)

[@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

2 participants