codergvbrownsville/code-rgv-pwa

React.PureComponent with out props injection? Looking for guidance.

Closed this issue · 1 comments

@piq9117
https://github.com/codergvbrownsville/code-rgv-pwa/blob/master/src/pages/Home/Home.tsx

I was under the impression that PureComponents are simply internally setup with a shallow comparison implementation of shouldComponentUpdate(). Without a constructor passing in props or initializing state, how is it different from a functional component?

Yours truly,
A Concerned Citizen

According to the docs its exactly like React.Component, but it implements shouldComponentUpdate to check for comparison. I used to implement this with react-pure-renderer-utils. However, since react implements it internally now I'll just use that.

I was trying it out on the Home component.lol. Sorry to confuse you.