React代码执行优先级中的问题

时间:2018-05-28 14:38:44

标签: reactjs react-native jsx

我理解代码执行优先级

1-构造函数

render() {
    return ({ this.authed == '' && <this.Nauthedcard /> });
}

2-然后是渲染功能

Nauthedcard()
{
   console.log(this.props.navigation); // makes error (this.props is undefined)

   return(<Button onPress={() => this.props.navigation.navigate('Home')} rounded small iconRight>
          <Text> Login </Text>
          <Icon type="FontAwesome" name="sign-in" />
        </Button>); // so unfortunately onPress event here makes error with me
}

3-这里的问题 - 它将this.navigation视为未定义

<?php
    $a = $_POST['myVar'];
    include "ScriptB.php";

0 个答案:

没有答案