React Native: нажатие кнопки OnPress не работает? - PullRequest
0 голосов
/ 22 апреля 2020
<View key={dataSource.id}>
          <Card borderRadius={5}>
            <CardItem cardBody>
              <Left>
                <Thumbnail
                  source={{uri: 'http://192.168.8.103:8000/images/1579124.png'}}/>
                <Body>
                  <Text>
                    {dataSource.first_name} {dataSource.last_name}
                  </Text>
                  <Text note>2020/04/17</Text>
                </Body>
              </Left>
            </CardItem>
            <CardItem>
              <Body>
                <Text>{dataSource.special_note}</Text>
              </Body>
            </CardItem>
            <CardItem>
              <Left>
                <Button transparent style={styles.button}>
                  <Image source={CALL} style={styles.icon} />
                  <Text>Audio Call</Text>
                </Button>
              </Left>
              <Body>
                <Button
                  transparent
                  onPress={this.loginHandler}
                  style={styles.button}>
                  <Image source={VIDEO_CALL} style={styles.icon} />
                  <Text>Video Call</Text>
                </Button>
              </Body>

              <Right>
                <Button onPress={() => this.props.navigation.navigate('Login')}>
                  <Text>View</Text>
                </Button>
              </Right>
            </CardItem>
          </Card>
    </View>

Я использовал родную базу и когда я нажимаю кнопку. Его ошибка типа get 'Undefined Is not and object'. И также я не мог вызвать функцию через событие нажатия onPress

Я использовал React Native 0.62.2 Native base 2.13.12

1 Ответ

0 голосов
/ 22 апреля 2020

Просто удалите это

const {navigate} = this.props;
...