博览会:3.27.4=> 4.1.3react-native-cli:2.0.1react-native:0.62.2=> 0.63.4@reduxjs/toolkit:1.5.0react-redux:7.2.2redux:4.0.5我是React-Native的新手,并且正在尝试将Redux实施到我的Expo应用程序中。此代码多次构建(我认为这是因为Expo registerRoo
2021-01-28
我有一个有效的<TextInput>:<TextInputplaceholder="Location"value={props.locationInput.toString()}onChangeText={location => props.updateLocationInput(location)}/>props.locationInput最初为'',但应用程序启动后,几个异步函数就会触发并获取
2017-05-04
我已经设置了我的 React Native 应用,所有 unimodules 和软件包的安装和配置都按预期工作。依赖关系等没有问题。现在我想实现一个 TensorFlow 模型,这个模型是我通过 Google 的 teachablemachine 训练的,我不明白如何将它与相机一起使用,因为我想实时处理帧,就像 TensorFlow React Native API 文档所说的那样。这是我在网上找
2021-06-23
我正在将数组映射到组件。{this.state.forms.map((data)=><Box data={data} />)}组件 Box 的代码是import React,{Component} from 'react'import {View,Text,ScrollView,Image,Button,StyleSheet,AsyncStorage} from 'react-native'cl
2018-09-11
我尝试了在网上看到的所有方法,但没有一个能解决我的问题。它总是给我“无法读取未定义的属性‘navigate’。我该如何解决这个问题?我将信息从 Page1 发送到 Header,但我无法从 Header 发送到 Page1。以及如何从 Header 转到 Page1,我的意思是如何通过单击某个按钮来打开 Page1import React, { Component } from 'react';i
2019-02-14
我正在使用 Firebase 和 react-native 来验证用户身份。我的主要文件是 App.js,我将用户发送到 Login 组件,并且我有两个组件来管理路由。Appnavigator.js 用于创建 switchNavigator,DrawerNavigator.js 用于 createDrawernavigator。身份验证后,我想将用户发送到一个内部组件(Admin)。以下是特定页面
2020-03-04
我正在制作一个口袋妖怪图鉴,我希望用户能够从FlatList单击一个口袋妖怪,然后转到该口袋妖怪的详细信息页面。但是,navigation.navigate 在基于类和函数的视图中均不起作用。我查看了文档,它使用了我尝试实现的方法。出了什么问题?App.jsimport * as React from 'react';import {NavigationContainer} from '@reac
2020-09-28
我在Books.js中的 Stack 导航器中有四个屏幕:function Books(props) {return (<Stack.Navigator><Stack.Screen name="Home" component={BooksMenu} /><Stack.Screen name="Order Book" component={BookOrder} /><Stack.Screen nam
2021-03-02
我有一个 Person 类,它具有 setName 和 getName 函数。var person = new Person("Johnny");this.setState({personObj: person})如果我调用 this.state.personObj.getName(); 我会按预期获得 Johnny。我知道您不应该直接更新状态,例如this.state.name = 'Johnn
2016-05-19
我有一个 JSON 对象存储我的菜单。默认情况下,会显示第一个菜单。按下任何菜单项时,我希望显示根据“seq”定义的菜单编号。这是我的 JSON 文件 **menu.json"{"main":[{"mid": 0, "menu":[{"id": "1", "title": "Item-1-0", "kw": "Item-1", "type" : "M", "seq" : 1},{"id": "2"
2019-02-27
我尝试在方法 start() 中更新状态,然后将状态的值传递给 MyComponent。我的组件工作正常,当我在类中设置它时,状态更新正常,但是当我尝试从 start 方法传递它时 - 它不起作用。得到“TypeError:this.setState 不是函数”已编辑 - 修复绑定但仍然不起作用。可能是什么问题?export default class App extends Component{
2020-01-17
我有一个简单的功能组件,根据状态显示“添加项目”或“删除项目”按钮:const SimpleComponent = ({ route }) => {const { id } = route.params;const [add, setAdd] = useState(false);useEffect(() => {{ isCurrentUserHavingThisItem(route, id) ?s
2021-04-01
我有两种字体,一种是应用使用阿拉伯语时使用的字体,另一种是应用使用英语时使用的字体。我的想法是在顶部声明状态,但当用户更改字体时,它会恢复为 false 状态。const App = ({navigation}) => {const [newFont, setNewFont] = useState();i18n.on('languageChanged', () => {console.log('l
2022-06-08
这是我遇到的错误BUILD FAILED in 1m 33serror Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.Error: Command failed: grad
2022-12-12
when I start pod install the result :CocoaPods could not find compatible versions for pod "RNDateTimePicker":In Podfile:RNDateTimePicker (from `../node_modules/@react-native-community/datetimepicker`)
2021-07-14