Skip to content

Commit

Permalink
Element: start reexporting PureComponent (#58076)
Browse files Browse the repository at this point in the history
* Element: start reexporting PureComponent

* Add PR reference to changelog
  • Loading branch information
jsnajdr authored Jan 23, 2024
1 parent 65c1f46 commit a74dec9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/element/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

- Started exporting the `PureComponent` React API ([#58076](https://github.com/WordPress/gutenberg/pull/58076)).

## 5.26.0 (2024-01-10)

## 5.25.0 (2023-12-13)
Expand Down
6 changes: 6 additions & 0 deletions packages/element/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,12 @@ const placeholderLabel = Platform.select( {
} );
```

### PureComponent

_Related_

- <https://reactjs.org/docs/react-api.html#reactpurecomponent>

### RawHTML

Component used as equivalent of Fragment with unescaped HTML, in cases where it is desirable to render dangerous HTML without needing a wrapper element. To preserve additional props, a `div` wrapper _will_ be created if any props aside from `children` are passed.
Expand Down
6 changes: 6 additions & 0 deletions packages/element/src/react.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
Fragment,
isValidElement,
memo,
PureComponent,
StrictMode,
useCallback,
useContext,
Expand Down Expand Up @@ -238,6 +239,11 @@ export { lazy };
*/
export { Suspense };

/**
* @see https://reactjs.org/docs/react-api.html#reactpurecomponent
*/
export { PureComponent };

/**
* Concatenate two or more React children objects.
*
Expand Down

0 comments on commit a74dec9

Please sign in to comment.