第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

錯(cuò)誤:未定義不是對(duì)象(評(píng)估 this.props.navigation.navigate)

錯(cuò)誤:未定義不是對(duì)象(評(píng)估 this.props.navigation.navigate)

我正在嘗試在我的應(yīng)用程序中實(shí)現(xiàn),當(dāng)我單擊“詳細(xì)信息”時(shí),它會(huì)轉(zhuǎn)到“detalhesJogadores”,但我沒(méi)有收到錯(cuò)誤“返回未定義不是對(duì)象(評(píng)估 this.props.navigation。導(dǎo)航)”listaindex.js   eslint-disable prettier/prettier    import {Text, View,StyleSheet,Image,TouchableOpacity} from 'react-native';    import React, {Component} from 'react';export default class JogadoresLista extends Component {   detalhes = () => { this.props.navigation.navigate( 'Detalhes' )}  render(){    return (      <View style={styles.viewDentro}>        <View style={styles.viewTop}>          <Image source={this.props.imageUri} style={styles.imagem} />            <View style={styles.viewBottom}>                <Text style={styles.textoP}>{this.props.name}</Text>                <Text style={styles.textoP}>{this.props.posicao}</Text>                <TouchableOpacity style={styles.botao} title="Detalhes"                onPress={this.detalhes}>                  <Text style={styles.textoB}>Detalhes</Text>                </TouchableOpacity>            </View>        </View>      </View>    );}}詳情Players.js/* eslint-disable no-trailing-spaces *//* eslint-disable prettier/prettier */import {Text, View, Image,StyleSheet} from 'react-native';import React, {Component} from 'react';export default class DetalhesJogadores extends Component {  render(){    return (      <View style={styles.viewDentro}>        <View style={styles.viewTop}>            <View style={styles.viewBottom}>                <Text style={styles.textoP}>Deu Certo</Text>            </View>        </View>      </View>    );  }}index.jsThis is the default page, where the user can click and go to the page/* eslint-disable prettier/prettier */import React from 'react';import {Text, TouchableOpacity, View, ScrollView, StyleSheet, Image} from 'react-native';import { SafeAreaView } from 'react-native-safe-area-context';import JogadoresLista from '../jogadores/listaIndex';import logoG from '../../images/icon.png';我想要關(guān)于如何繼續(xù)解決這個(gè)問(wèn)題的幫助,因?yàn)槲也恢牢以谧鍪裁戳?
查看完整描述

1 回答

?
30秒到達(dá)戰(zhàn)場(chǎng)

TA貢獻(xiàn)1828條經(jīng)驗(yàn) 獲得超6個(gè)贊

我在沒(méi)有課程的情況下制作了您的版本。這應(yīng)該與鉤子 useNavigation 一起使用。


這適用于 react-navigation v5.x


import React from 'react'

import { Text, View, Image, StyleSheet, TouchableOpacity } from 'react-native'

import { useNavigation } from '@react-navigation/native'


export default props => {

    const navigation = useNavigation()

    const detalhes = () => navigation.navigate('Detalhes')

    // or , if you need to send params too 

    // const detalhes = id => navigation.navigate('Detalhes',{playerId: id})

    return (

      <View style={styles.viewDentro}>

        <View style={styles.viewTop}>

          <Image source={props.imageUri} style={styles.imagem} />

            <View style={styles.viewBottom}>

                <Text style={styles.textoP}>{props.name}</Text>

                <Text style={styles.textoP}>{props.posicao}</Text>

                <TouchableOpacity style={styles.botao} title="Detalhes"

                onPress={detalhes}>

                  <Text style={styles.textoB}>Detalhes</Text>

                </TouchableOpacity>

            </View>

        </View>

      </View>

    )

}


const styles = StyleSheet.create({

    // styles here

})


查看完整回答
反對(duì) 回復(fù) 2022-07-08
  • 1 回答
  • 0 關(guān)注
  • 120 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)