【问题标题】:React navigation example JS grammarReact 导航示例 JS 语法
【发布时间】:2017-10-15 07:33:05
【问题描述】:

【问题讨论】:

    标签: javascript react-native react-navigation


    【解决方案1】:

    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} />
    }}
    

    【讨论】:

    • 什么是'const {navigation} = this.props;'
    • this 等于 'const navigation = this.props.navigation'
    • 非常感谢,你是怎么知道这些的?我在哪里可以找到文件?
    • 这不是 react native 语法,它来自新的 ECMAScript 语法。
    猜你喜欢
    • 2016-08-14
    • 1970-01-01
    • 1970-01-01
    • 2017-09-22
    • 2017-06-19
    • 2023-01-30
    • 2015-12-31
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多