React Performance ⚡¶
- better UX
import React from "react"; const Dashboard = React.lazy( () => import(/* webpackChunkName: "Dashboard" */ "../Pages/Dashboard") );
The Webpack magic comment
webpackChunkName determines the downloaded chunk name.
Storing processed functions based on received props, avoiding the memory effort to the same component.
- React Memo
import React from "react"; const Comp = () => ( <div className="mt-3"> <h1>Title</h1> </div> ); export default React.memo(Comp);
Last update: 2023-03-20