运行 razzle 的基本安装,我收到错误“Cannot GET /”,这就是我所做的:
https://github.com/jaredpalmer/razzle
npx create-razzle-app my-app cd my-app npm start
运行 razzle 的基本安装,我收到错误“Cannot GET /”,这就是我所做的:
https://github.com/jaredpalmer/razzle
npx create-razzle-app my-app cd my-app npm start
对于绊倒这个的人:
在模板中需要更改 client.js
import BrowserRouter from 'react-router-dom/BrowserRouter';
至
import {BrowserRouter} from 'react-router-dom';
在 App.js 中
import Route from 'react-router-dom/Route';
import Switch from 'react-router-dom/Switch';
至
import {Route,Switch} from 'react-router-dom';