"props should be defined" 但是怎么办?

"props should be defined" but how?

我是 React 和 React Native 的新手。

我正在尝试使用本教程设置一个简单的应用程序

https://github.com/aksonov/react-native-router-flux/blob/master/docs/MINI_TUTORIAL.md

我已经使用此命令设置了我的应用程序

create-react-native-app my-project

我启动应用程序并在我的 phone 上看到它。

然后

npm i react-native-router-flux --save

我用该教程中的所有代码替换了 App.js 的内容。我还创建了所需的 PageOne.jsPageTwo.js.

然后我在 phone 上立即收到错误消息。

[react-native-router-flux] props should be defined

assert c:\my path...\react-native-router-flux\src\Util.js@34:10

如何定义这些道具?我需要做什么才能让它正常工作?

额外内容!

代码与教程中的完全一样,

App.js

import React, { Component } from 'react';
import { Router, Scene } from 'react-native-router-flux';

import PageOne from './PageOne';
import PageTwo from './PageTwo';

export default class App extends Component {
  render() {
    return (
      <Router>
        <Scene key="root">
          <Scene key="pageOne" component={PageOne} title="PageOne" initial={true} />
          <Scene key="pageTwo" component={PageTwo} title="PageTwo" />
        </Scene>
      </Router>
    )
  }
}

PageOne.js

import React, { Component } from 'react';
import { View, Text } from 'react-native';
import { Actions } from 'react-native-router-flux';

export default class PageOne extends Component {
  render() {
    return (
      <View style={{margin: 128}}>
        <Text onPress={Actions.pageTwo}>This is PageOne! </Text>
      </View>
    )
  }
}

PageTwo.js

import React, { Component } from 'react';
import { View, Text } from 'react-native';
import { Actions } from 'react-native-router-flux';

export default class PageTwo extends Component {
  render() {
    return (
      <View style={{margin: 128}}>
        <Text onPress={Actions.pageOne}>This is PageTwo!</Text>
      </View>
    )
  }
}

我真的没有确凿的答案。也许只是对许多不同的运动部件不熟悉导致了一些不合时宜的事情。

我根据本页的升级table更新了package.jsonapp.json中的一些幻数

https://github.com/react-community/create-react-native-app/blob/master/VERSIONS.md

一切又开始正常了。

我想我在安装各种 React 东西时的一些挣扎已经让安装的版本不合时宜了。也许如果我真的了解这个生态系统,它对我来说似乎很清楚,但现在感觉就像一堆绳子和绳索!