代码之家  ›  专栏  ›  技术社区  ›  Gilson

使用React导航创建React应用程序

  •  1
  • Gilson  · 技术社区  · 7 年前

    我从Create React应用程序创建了一个应用程序,它运行得很好。 当我添加react navitation时,我得到了这个错误:

    ./node_modules/react-navigation/src/routers/StackActions.js
    Module parse failed: Unexpected token (10:2)
    You may need an appropriate loader to handle this file type.
    | const pop = payload => ({
    |   type: POP,
    |   ...payload,
    | });
    |
    

    看来我们没有“Transform Object Rest Spread”Babel插件。有人知道我该怎么加吗?

    这是我在package.json中的依赖项:

     "dependencies": {
        "react": "^16.4.1",
        "react-dom": "^16.4.1",
        "react-navigation": "^2.6.2",
        "react-scripts": "1.1.4"
      }
    
    2 回复  |  直到 7 年前
        2
  •  1
  •   Andrew Irwin    7 年前

    react-navigation create-react-app

    here