我从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"
}