Skip to content

devilmancbc/wh_blog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Getting Started with Create React App

This project was bootstrapped with Create React App.

Available Scripts

In the project directory, you can run:

npm start

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.

npm test

Launches the test runner in the interactive watch mode.
See the section about running tests for more information.

npm run build

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.

npm run eject

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.

Learn More

You can learn more in the Create React App documentation.

To learn React, check out the React documentation.

Code Splitting

This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting

Analyzing the Bundle Size

This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size

Making a Progressive Web App

This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app

Advanced Configuration

This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration

Deployment

This section has moved here: https://facebook.github.io/create-react-app/docs/deployment

npm run build fails to minify

This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify

6.3

问题:axios 请求发送失败

原因:请求体变量名称不对、没有添加 head

6.4

浏览器缓存添加方式:localStorage.setItem,添加成功的缓存到 “检查”=> application 查看

react 里的 js 语句要用 {} 括起来

合并分支

本地操作:

  1. 子分支提交完成后切换到 master 分支

  2. git merge 子分支:把子分支合并到 master 分支

  3. git push origin master:把合并完成的最新 master 分支推送到远程仓库

6.5

问题:检查不到对函数的调用

原因:没用this.

6.6

问题:getToken失败

原因: (1) 引用调用函数返回值忘记加(), (2) getToken 函数没有返回值,箭头函数和普通函数写法混淆

6.7

问题:setstate 之后 state 控制台打印的结果没有及时更新

解决办法:

this.setState({ person: {} }, () => { ...想要在更新完成后执行的代码... });

问题: react地址变了,但是页面不跳转问题

原因: App.js 组件中,已经引入了 history , 就不再需要使用 BrowserRouter,直接使用 Router 就可以了

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published