React navigation example JS grammar

时间:2017-05-16 09:37:25

标签: javascript react-native react-navigation

1 个答案:

答案 0 :(得分:0)

const MyHomeScreen = ({ navigation }) => ( <MyNavScreen banner="Home Screen" navigation={navigation} /> );

等于

class MyHomeScreen extends React.Component{

constructor(props){
    super(props);
}

render(){

    const {navigation} = this.props;

    return <MyNavScreen banner="Home Screen" navigation={navigation} />
}}