Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add react ref and key props to components #37

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

Merged
MoOx merged 2 commits into rescript-react-native:master from Freddy03h:refs
Aug 20, 2020

Conversation

Copy link
Member

@Freddy03h Freddy03h commented Aug 17, 2020

  • 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

@Freddy03h Freddy03h Aug 19, 2020

Choose a reason for hiding this comment

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

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

Copy link
Member Author

I added key only for components made with makeProps

Copy link
Member

MoOx commented Aug 20, 2020

Oh that's right, I read too quickly!

Freddy03h reacted with thumbs up emoji

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

MoOx commented Aug 20, 2020

5.0.1 is out :)

Freddy03h reacted with thumbs up emoji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@MoOx MoOx MoOx requested changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /