开发者问题收集
我使用FlatList的第一个页面是:import React, { Component } from 'react';import { View, StyleSheet, FlatList, Text, TouchableHighlight } from 'react-native';import { StackNavigator } from 'react-navigation';import
我收到错误TypeError:无法读取未定义的属性“navigation”。我不明白如何将导航组件传递给每个子组件,以便当用户按下某个项目时,它可以使用 React Navigation 导航到 employeeEdit 组件。我是新手,如果这很明显,我很抱歉。import React, { Component } from 'react';import { FlatList } from 're
我正在尝试创建无状态组件来显示 Flatlist,但在导航方面却遇到了困难。这是我的“主”app.js,已精简:import React from 'react';import { AppRegistry, FlatList, ActivityIndicator, Text, View, Image, StyleSheet } from 'react-native';import { StackN
我有一个产品列表,需要从该列表导航到每个产品,并显示从 HomeScreen 传递到 DetailsS​​creen 的数据。我正在尝试使用 react-navigation 在屏幕之间导航。当我导航到 DetailsS​​creen 时,我将下面的 JSON 数据作为状态传递。找不到正确的解决方案来导航到单击的产品。我怎样才能将数组中的一个项目传递给下一个屏幕,以便当您打开 DetailsS​​
当我单击平面列表中的某一项时,我试图导航到另一个屏幕。我这里的代码已经工作了几天,但现在不行了,当应用程序加载时,EventDetailScreen 在我单击任何平面列表项之前就打开了,然后当我按下 EventDetailScreen 的后退按钮时,我会回到 EventListScreen,如果我单击任何列表项,什么都不会发生,我也不会进入 EventDetailScreen。我也收到错误:War
我正在使用 react-native (expo) firebase 和 flamelink 作为 cms 构建应用程序,我需要创建一个项目列表,其中包含一些项目登录页面。我使用 flatlist 来呈现我的项目列表,但现在我需要从项目卡导航到详细信息页面。我做错了什么?import React from 'react';import {Image,Platform,ScrollView,Styl
我希望在单击 FlatList 中的项目时导航到名为 GridVid 的屏幕。我不知道该如何做,因为onPress={() => this.props.navigation.navigate('GridVid')}只有在 App.js 中调用才有效,因为 StackNavigator 就是在那里定义的,而不是 ListItem 类(位于名为 ListItem.js 的单独文件中)//App.jsc
我想知道如何在 FlatList 属性上使用 React Navigation,其中Stack.Screen的名称来自.json文件。这样,当用户点击该项目时,他们会转到应用程序的另一个页面。数据{Data: [{"key": "0","label": "Test","goTo": "Test", <--- Here goes the name of Stack.Screen from route
我有一个组件InventoryScreen,它包含一个像这样的Flatlist:<FlatListnumColumns={2}data={filteredData}keyExtractor={(item, index) => index.toString()}renderItem={renderItem}stickyHeaderIndices={[0]}keyboardDismissMode={"
我收到以下错误:Possible unhandled promise rejection (id:0: Network request failed)`这是承诺代码,我看不出这里有什么问题,有什么想法吗?return fetch(url).then(function(response){return response.json();}).then(function(json){return {ci
我遇到了一个问题,当我调用一个方法并向其传递参数时,我收到一个错误,并且按钮后面的操作会自动运行。这是我的渲染:render() {return (<View style={styles.container}><Card><CardSection><ButtonaccessibilityLabel='Click this button to find somewhere you and your
在我的 React Native 应用中,我有一个自定义登录 Facebook 按钮:<Button onPress={() => this.handleFacebookLogin()}><Text>Login with Face</Text></Button>以及 handleFacebookLogin 函数: handleFacebookLogin () {LoginManager.logIn
我收到未处理的承诺拒绝警告,并且未定义不是对 this.state.gridData[0].brand 进行评估的对象这部分代码有问题async componentDidMount() {const bikes = await fetchVehicleBasedOnType(VEHICLE_TYPES.TWO_WHEELER);this.setState({ bikes });const grid
在我的数据加载器中,我得到的响应是这样的: method: 'PUT'}).then(response => response.json().then(json => {response.ok ? json : Promise.reject(json)})).then(schematizeResponse)在我的屏幕上,我有一个按钮可以调度该函数,它是: _updateValues(){try{
我在尝试将数据存储在 React Native 中的 AsyncStorage 中时收到此错误并且数据也未添加到存储中Possible Unhandled PromiseRejection (id: 0): Error: com.facebook.react.bridge.ReadableNativeMapcannot be cast to java.lang.String Error:com.f