-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Element: start reexporting PureComponent #58076
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
Conversation
|
Size Change: +8 B (0%) Total Size: 1.7 MB
ℹ️ View Unchanged
|
Mamaduka
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @jsnajdr!
|
Flaky tests detected in 4c623f4f1eceae00426320869c4c89e657574167. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7612555314
|
tyxla
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks 👍
Perhaps we should link to the new docs site?
packages/element/README.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we should link to the new docs:
| - <https://reactjs.org/docs/react-api.html#reactpurecomponent> | |
| - <https://react.dev/reference/react/PureComponent> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we should link to the new docs:
Why not, but let's do it for all references, in its own PR. Searching for "reactjs.org/docs" shows me 100 references, in various JSDoc comments and Markdown documents.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, although I didn't want to burden you with doing it for all existing usages 😅
packages/element/src/react.js
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| * @see https://reactjs.org/docs/react-api.html#reactpurecomponent | |
| * @see https://react.dev/reference/react/PureComponent |
4c623f4 to
00e6671
Compare
Follow-up to discussion in #57173: start re-exporting
PureComponentfrom@wordpress/element. The goal is to keep parity withreact, without any gotchas or surprises.PureComponentis marked as "legacy API" by React docs, but so are all class component APIs likeComponentorcreateRef, and also functions likecloneElementwhich we use quite often. They are all still ubiquitous in a lot of React code.