- https://codeburst.io/redux-a-crud-example-abb834d763c9
- https://github.com/react-boilerplate/react-boilerplate
- https://api-platform.com/docs/client-generator/react
- https://demo.api-platform.com/
- https://developer.okta.com/blog/2018/07/10/build-a-basic-crud-app-with-node-and-react
- https://material-ui.com/
- https://www.sohamkamani.com/blog/2017/03/31/react-redux-connect-explained/
npm install -g create-react-app
npm list -g create-react-app
/usr/local/lib
└── [email protected]
create-react-app crud-redux
npm install --save redux react-redux
npm install material-ui --save
npm install --save-exact @babel/[email protected]
npm add @babel/runtime
restful api tutorial
npm install axios -S
- https://stackoverflow.com/questions/32317154/react-uncaught-typeerror-cannot-read-property-setstate-of-undefined
- https://stackoverflow.com/questions/41042763/axios-reactjs-cannot-read-property-setstate-of-undefined/41042834
- https://stackoverflow.com/questions/44230120/cannot-read-property-setstate-of-undefined-in-axios-callback?rq=1
The problem is not that the state doesn't exist, it is that you are not using the correct context for state.
You need to bind the axios callback function, otherwise this inside it will refer to its own context rather than that of the react component
change below code
.then(function (response) {
to
.then((response) => {
- Do not use below git submodule
- https://medium.com/@justintulk/how-to-turn-your-reusable-react-components-into-an-external-dependency-part-1-ae29b4d4e5
git clone https://github.com/creativetimofficial/light-bootstrap-dashboard-react.git
or
git submodule add https://github.com/creativetimofficial/light-bootstrap-dashboard-react.git
- Do use below $ yarn add GIT_URL
yarn add https://github.com/creativetimofficial/light-bootstrap-dashboard-react.git
{
"name": "post-reactjs2",
"version": "0.1.0",
"private": true,
"dependencies": {
"babel-eslint": "^9.0.0",
"babel-jest": "23.6.0",
"babel-loader": "^8.0.4",
"eslint": "5.6.0",
"light-bootstrap-dashboard-react": "https://github.com/creativetimofficial/light-bootstrap-dashboard-react.git",
"react": "^16.5.2",
"react-dom": "^16.5.2",
"react-scripts": "2.0.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
]
}
rm -rf node_modules
yarn build
yarn start
$ npm install --save react-router-dom
- https://medium.com/@pshrmn/a-simple-react-router-v4-tutorial-7f23ff27adf
- https://reacttraining.com/react-router/web/example/url-params
- https://gist.github.com/abohannon/cca2dd998edf9dc2c2165f538eece4b2
- https://serverless-stack.com/chapters/redirect-on-login-and-logout.html
- https://alligator.io/react/axios-react/