sumakokima2 / resium-sample2

0 stars 0 forks source link

3-6 Pure Component と Stateless Component と key #18

Open sumakokima2 opened 5 years ago

sumakokima2 commented 5 years ago

Pure Component

React.PureComponent is similar to React.Component. The difference between them is that React.Component doesn’t implement shouldComponentUpdate(), but React.PureComponent implements it with a shallow prop and state comparison.

If your React component’s render() function renders the same result given the same props and state, you can use React.PureComponent for a performance boost in some cases.