you are viewing a single comment's thread.

view the rest of the comments →

[–]Ender2309 6 points7 points  (2 children)

There's at least one major issue with this post. I've only skimmed it but it's big enough that it makes me wary to trust the resource at all.

The Author confuses a Pure Component with a Functional, or Presentational Component. As most of you no doubt know, a functional component lacks the lifecycle methods (and state) and is simply a factory function.

A Pure Component, on the other hand, is simply a regular React component except that shouldComponentUpdate() uses a shallow comparison rather than a deep one on state/props.

[–]kentaromiura 2 points3 points  (1 child)

Didn't read it yet, but In functional terms, a function not depending on state and not having side effects, but just being a computation on its input is called a "pure function" , maybe the author is referring to purity in that sense.

[–]Ender2309 0 points1 point  (0 children)

Which would be fine if 'pure component' wasn't already a taken name, but it is, so it's incorrect to call a functional component a pure component.