下载安装react-router需要注意的 可以使用npm ,也可以使用yarn 比如使用yarn时,不是仅仅安装react-router这个命令,而是react-router-dom,这个更全。 命令: yarn add react-router-dom