无法在reactnative中分配给# 的只读属性props

无法分配给的只读属性"props"#

我查了#1654,但没有成功.请在这里更详细地了解这个问题-

Screenshot of error

基本上,我所做的是使用导航器从索引页面移动到ApplistGridView页面.

和chrome调试消息-

Chrome Debug messages

代码是Github

推荐答案

正如错误所述,由于组件属性是只读的,因此无法推送到props this.props.nav.push({id: 'Applist', index: 2});.props 只能从父组件派生,但不能修改.

编辑:这篇文章是一个很好的起点,对于那些像我之前一样对这件事感到困惑的人来说:)

React-native相关问答推荐

'未能找到 React 根视图的片段' React Native Android RNScreens

用图像 react native 动画进度条

如何将 react-native 图像从 expo-image-picker 上传到使用 multer 的 Express.js 后端

React Native:在ScrollView中更改焦点时键盘关闭

React Native:在 ScrollView contentContainerStyle 上设置 flex:1 会导致组件重叠

在Windows中连接到远程调试器时react-native 超时

如何运行 React-Native 示例?

React-Native 按钮居中对齐

Realm 和 React Native - 实现自动更新的最佳实践?

React-Native Android 中隐藏(hide)的元素溢出

在Android上更改高度时react-native TextInput显示错误

将 react-native 元素Bundle 为 iOS 框架或 (.aar) Android 库

React Native Image 不显示,我该如何解决?

iOS ActionSheet 的 Android 类似功能

带有父 PanResponder 的 TouchableOpacity

如何在react-native中显示toast消息

react-native:多色文本视图

手动调用 React.PropTypes 验证 React native "^0.30.0"

react-native iOS 应用在部署后不显示静态/本地资源

NavigationActions.reset 不是函数吗?