N
N
Nikolai Antonov2016-12-20 19:51:38
React
Nikolai Antonov, 2016-12-20 19:51:38

Should I always use React.PureComponent instead of React.Component?

Not so long ago, React.PureComponent appeared in react , which differs in that it does a shallow comparison of changes itself. Should we ditch React.Component for good? And can there be bugs if we replace React.Component with React.PureComponent throughout the project?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya, 2016-12-20
@FireGM

1. If you are satisfied with a superficial check, then it is worth it.
2. Yes, if you pass not immutable, but mutable data to the component, because of which you need to rebuild the dom, then the project will be broken.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question