-
Notifications
You must be signed in to change notification settings - Fork 0
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
Better API #6
Comments
|
@bsr203 I'm playing a little bit with the API here. Idea is to use any Reason data structure for params (like polymorphic variants) to pass different types of payload between different routes. Having param type bound to screen rather than whole navigation forces you to define param type when you get params rather than set them. I think it's better to have one data structure with multiple states. Let's imagine application that displays list of products and single product details. You can define your params as: type params = option(string) so you set it to type params = [ `Initial | `Product(string) | ProductQuantity(string, int) ] which is more flexible. Similar situation is with It's only experiment. This library is not production ready. Soon I'll be starting large Reason React Native application so probably I'll use this library internally and iterate over the API during the project. I hope this will validate mu assumptions and allow me to make this library production ready. |
Thanks @baransu for your work on this. I will get back to using it in few days, and will give my feedback. I can't wait to see the improvements as you started using it heavily. Cheers. |
Current API is exactly the same (or similar) as original JS
react-navigation
API. It has it's limitations and in Reason it doesn't work so well. The ideal navigation definition would be done using variants. It allow to have very strong types, pass params to specific screens or event create special mapping between deep linking and navigation.Here is some quick sketch of something I have in mind. Only thing I'm missing is how to convert it to
react-navigation
API.The text was updated successfully, but these errors were encountered: