React-boilerplate: [Questions] React.Component vs React.PureComponent

Created on 16 Dec 2016  路  3Comments  路  Source: react-boilerplate/react-boilerplate

React.Component vs React.PureComponent ??
whether the fundamental difference between them

Can you include a valid argument ...
I look at react 1.5 , even though we use the Component directly [extends Component], they will automatically do checked / deep equal check in state change before decide to rerender the components

Most helpful comment

Can you include a valid argument ...

Have you seen the docs?

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_.

See #811 for more.

All 3 comments

Can you include a valid argument ...

Have you seen the docs?

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_.

See #811 for more.

ahh.... thx @gihrig . clearly information
since our state base on redux state... PureComponet is better for performa
PureComponet = Shallow check when props arrived

https://github.com/facebook/react/pull/7195/files#diff-6363300a479c9057729248ca9dd3e7b6R874

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

loicginoux picture loicginoux  路  4Comments

williamgranli picture williamgranli  路  3Comments

rangerch picture rangerch  路  4Comments

sunkant picture sunkant  路  3Comments

VadimuZz picture VadimuZz  路  4Comments