Allow the passing of props and bumped dependency versions
Why
props
Originally had to pass data object and call it via this.props.data.myProp which seems unnecessary.
dependencies
If you had a recent version of react-native, you would get errors when running npm start
Unable to resolve module ./base64-vlq from /Users/mikaelcarpenter/gears-native/node_modules/react-native-router/node_modules/react-native/Libraries/JavaScriptAppEngine/Initialization/SourceMap.js
{so on and so on}
What
props
Instead of passing data in your route, you can now pass passProps which takes in an object, and then creates a prop for each key: value pair in the object.
dependencies
Updated the version numbers in package.json dependencies.
This is also an update to a previous PR (#47) by wenkesj
Issue
Example
_initialRoute = {
name: 'Title'
component: Home
passProps: {
prop1: 'hi'
prop2: 'bye'
}
}
App = React.createClass({
render: function() {
return (
<Router firstRoute={_initialRoute} />
)
}
})
module.exports = App
Your Home component can now use this.props.prop1 and this.props.prop2
@t4t5 :D
also for anyone wanting to make these changes manually to their project. After updating the dependencies: cd node_modules/react-native-router and npm update to apply the changes
@jhabdas I haven't checked it out yet, but would you want to use it for the nav bar transitions rather than the opacity from tween-state?