React & Redux

Starting a new React Project

Install create-react-app from npm

npm install -g create-react-app

Create a new app called "example-app"

create-react-app example-app
cd example-app

Building & running an application

npm start

Runs the app in development mode. Open http://localhost:3000 to view it in the browser.

npm test

Runs the test watcher in an interactive mode.

npm run build

Builds the app for production to thebuildfolder. It correctly bundles React in production mode and optimizes the build for the best performance.

Lifting State Up

When you want to aggregate data from multiple children or to have two child components communicate with each other, move the state upwards so that it lives in the parent component. The parent can then pass the state back down to the children via props, so that the child components are always in sync with each other and with the parent.

React’s render method

results matching ""

    No results matching ""