我有一个FlatList显示在DeviceList.js上,在单击FlatList项时,我想导航到MainContainer.js组件,并将相关数据传递给detail组件。由于我刚开始对本机做出反应,所以尽管我已经在主屏幕上实现了FlatList,但我还是很难实现这个功能。FlatList是在DeviceList.js组件下实现的,在Boat.js中单击导航,我想从这个组件导航到MainContainer.js组件。
App.js
import React from 'react';
import { Image } from 'react-native';
i
我想知道如何在FlatList属性上使用React导航,Stack.Screen的名称来自于.json文件。
这样,当用户单击该项目时,他们会转到应用程序的另一个页面。
数据
{
Data: [
{
"key": "0",
"label": "Test",
"goTo": "Test", <--- Here goes the name of Stack.Screen from routes.js
}
]
}
FlatList结构
fu
我收到了错误TypeError:无法读取未定义的属性“导航”。我不明白如何将导航组件传递给每个子组件,因此当用户按下某个项时,它可以使用React导航到employeeEdit组件。如果这很明显,我很抱歉。
import React, { Component } from 'react';
import { FlatList } from 'react-native';
import { connect } from 'react-redux';
//import { R } from 'ramda';
import _ from