Things about React, React Optimizing Performance

Shihab Ahmed
3 min readMay 7, 2021
React Js

React is not a framework

React is just a library where you make all decisions by yourself. React is a user interface using components. The framework is where some decisions make already. Angular is a framework where already some decision build.

Rendering Works

Every setState call informs React about state changes. Then, React calls the render method to update the component's representation in memory and compare it with what’s rendered in the browser. Child components know that they need to re-render because their props changed.

React don’t need Flux

Redux is great. But you might not need it.

React Optimizing Performance

Create react App:

npx create-react-app my-app
cd my-app
npm start

If the project builds with create react app run:

-> npm run build

This will create /builda folder

Single-File Builds:

Production-ready versions of React and React DOM as single files

Branch:

For the most efficient Brunch production build, install the terser-brunch plugin:

Then, to create a production build, add the -p flag to the build command:

Browserify:

For the most efficient Browserify production build, install a few plugins:

Rollup:

For the most efficient Rollup production build, install a few plugins:

Webpack:

Webpack v4+ will minify your code by default in production mode.

--

--