This project was bootstrapped with Create React App.
In the project directory, you can run:
Runs the app in the development mode.
Open http://localhost:3000 to view it in your browser.
The page will reload when you make changes.
You may also see any lint errors in the console.
Launches the test runner in the interactive watch mode.
See the section about running tests for more information.
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.
Note: this is a one-way operation. Once you eject
, you can't go back!
If you aren't satisfied with the build tool and configuration choices, you can eject
at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject
will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.
You don't have to ever use eject
. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.
You can learn more in the Create React App documentation.
To learn React, check out the React documentation.
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
问题:axios 请求发送失败
原因:请求体变量名称不对、没有添加 head
浏览器缓存添加方式:localStorage.setItem,添加成功的缓存到 “检查”=> application 查看
react 里的 js 语句要用 {} 括起来
本地操作:
-
子分支提交完成后切换到 master 分支
-
git merge 子分支
:把子分支合并到 master 分支 -
git push origin master
:把合并完成的最新 master 分支推送到远程仓库
问题:检查不到对函数的调用
原因:没用this.
问题:getToken失败
原因: (1) 引用调用函数返回值忘记加(), (2) getToken 函数没有返回值,箭头函数和普通函数写法混淆
问题:setstate 之后 state 控制台打印的结果没有及时更新
解决办法:
this.setState({ person: {} }, () => { ...想要在更新完成后执行的代码... });
问题: react地址变了,但是页面不跳转问题
原因: App.js 组件中,已经引入了 history , 就不再需要使用 BrowserRouter,直接使用 Router 就可以了