-
-
Save ronal2do/2b0b37194a438ee827d8e3a435fd5fdb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import paramsToProps from 'paramsToProps.js' | |
const MainNavigator = StackNavigator({ | |
firstScreen: { screen: paramsToProps(FirstScreenComponent) }, | |
secondScreen: { screen: paramsToProps(SecondScreenComponent) }, | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
export default (OriginalComponent) => { | |
return class ParamsToPropsWrapper extends Component { | |
static navigationOptions = OriginalComponent.navigationOptions; | |
render() { | |
const params = this.props.navigation.state.params; | |
return <OriginalComponent {...this.props} {...params} /> | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment