Set default params in a screen component
complete
Brent Vatne
complete
this landed in this PR: https://github.com/react-navigation/react-navigation-core/pull/11
it'll be available in 3.0, which is currently in alpha but rc coming soon
Harshul Sharma
This behavior could be mimiced by passing some default values from parent component as params. Although having some built in functionality could help remove confusion.
Bruce Flowers
Harshul Sharma: if this is a viable workaround (until the feature is built properly), can you show an example of how to do it?
Harshul Sharma
Bruce Flowers: Well I hope, inside render() of desired screen you can used set params and es5 style || operator to check if a param has a value and if not supply with yours.
Alexander Petcoglo
Harshul Sharma: In my case it's not about just having the default params, but the ability to assign them. I'm using the same screen to display different datasets and I need to know which one to use. For now I decided to go with checking the state.routeName to differentiate between them. But I would like to do this in a more explicit way.