Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

export PureComponent #8120

Closed
wants to merge 1 commit into from
Closed

Conversation

Shelob9
Copy link
Contributor

@Shelob9 Shelob9 commented Jul 22, 2018

Description

I added an export for React.PureComponent and a test to prove its exported as a function. #8118

How has this been tested?

I wrote a unit test to prove element.PureComponent is a function.

Checklist:

  • [ x] My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards. Not applicable
  • My code has proper inline documentation.

@gziolo
Copy link
Member

gziolo commented Jul 23, 2018

We provide pure higher-order component (HOC) which plays the same role but uses slightly modified implementation:
https://github.com/WordPress/gutenberg/blob/master/packages/compose/src/pure/index.js

It's also worth to mention that it is baked in into withDispatch HOC, so you might be using it already, but you weren't aware of it :)

I think @aduth or @youknowriad can give a more detailed explanation to the topic.

@gziolo gziolo added the [Package] Element /packages/element label Jul 23, 2018
@youknowriad
Copy link
Contributor

Yes, pure is basically the same thing written as a Higher-order component instead. I think it's slightly more flexible. Related discussion in the original PR #6313

@gziolo gziolo added the [Status] Not Implemented Issue/PR we will (likely) not implement. label Jul 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Element /packages/element [Status] Not Implemented Issue/PR we will (likely) not implement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants