-
-
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
Feature for render callback of stack screen #32
Feature for render callback of stack screen #32
Conversation
This introduce a cost for the binding and a door to bugs. |
But with that both children and component can be None or both of them can be provided, which would lead to app crash. |
react navigation really trigger a crash if you forget component or children? |
If I am correct this error happen on first launch, when the routing is being processed right? Isn't it acceptable to have this "runtime error" with zero cost bindings? |
I am thinking about another zero cost solution: implement 2 components Screen (component) & ScreenWithCallback (render prop) |
Implemented two components Screen and ScreenWithCallback. |
"route": route, | ||
}), | ||
), | ||
children: option(renderCallbackProp => React.element), |
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.
Maybe instead we should have screenProps & screenPropsWithCallback?
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.
https://github.com/reason-react-native/reason-react-navigation/blob/master/src/Stack.re#L288
But argument of Screen function here can be only of one type right?
I'm really interested on this change! |
@Freddy03h Would make sense indeed. @a-c-sreedhar-reddy can you handle this? |
@a-c-sreedhar-reddy up about the request :) Do you want us to handle it if you don't have time? |
Yes @MoOx .🙂 |
@Freddy03h would you like to handle that in another PR? |
Ok I'll try to duplicate the changes on the tabs navigators |
Thanks! |
Closes #31