-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Element: start reexporting PureComponent #58076
Conversation
Size Change: +8 B (0%) Total Size: 1.7 MB
ℹ️ View Unchanged
|
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
|
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?
|
||
_Related_ | ||
|
||
- <https://reactjs.org/docs/react-api.html#reactpurecomponent> |
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 😅
@@ -238,6 +239,11 @@ export { lazy }; | |||
*/ | |||
export { Suspense }; | |||
|
|||
/** | |||
* @see https://reactjs.org/docs/react-api.html#reactpurecomponent |
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
PureComponent
from@wordpress/element
. The goal is to keep parity withreact
, without any gotchas or surprises.PureComponent
is marked as "legacy API" by React docs, but so are all class component APIs likeComponent
orcreateRef
, and also functions likecloneElement
which we use quite often. They are all still ubiquitous in a lot of React code.