Skip to content

Commit

Permalink
Export more APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnajdr committed Dec 16, 2022
1 parent bd185af commit c9555a7
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/element/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

### New Features

- Started exporting new React 18 APIs: `useSyncExternalStore`, `createRoot` and `hydrateRoot`
- Started exporting new React 18 APIs ([46610](https://github.com/WordPress/gutenberg/pull/46610))

## 4.20.0 (2022-11-16)

Expand Down
30 changes: 30 additions & 0 deletions packages/element/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,12 @@ _Returns_

- `string`: Serialized element.

### startTransition

_Related_

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

### StrictMode

Component that activates additional checks and warnings for its descendants.
Expand Down Expand Up @@ -397,18 +403,36 @@ _Related_

- <https://reactjs.org/docs/hooks-reference.html#usedebugvalue>

### useDeferredValue

_Related_

- <https://reactjs.org/docs/hooks-reference.html#usedeferredvalue>

### useEffect

_Related_

- <https://reactjs.org/docs/hooks-reference.html#useeffect>

### useId

_Related_

- <https://reactjs.org/docs/hooks-reference.html#useid>

### useImperativeHandle

_Related_

- <https://reactjs.org/docs/hooks-reference.html#useimperativehandle>

### useInsertionEffect

_Related_

- <https://reactjs.org/docs/hooks-reference.html#useinsertioneffect>

### useLayoutEffect

_Related_
Expand Down Expand Up @@ -445,6 +469,12 @@ _Related_

- <https://reactjs.org/docs/hooks-reference.html#usesyncexternalstore>

### useTransition

_Related_

- <https://reactjs.org/docs/hooks-reference.html#usetransition>

<!-- END TOKEN(Autogenerated API docs) -->

## Contributing to this package
Expand Down
42 changes: 36 additions & 6 deletions packages/element/src/react.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,22 @@ import {
isValidElement,
memo,
StrictMode,
useState,
useEffect,
useContext,
useReducer,
useCallback,
useContext,
useDebugValue,
useDeferredValue,
useEffect,
useId,
useMemo,
useRef,
useImperativeHandle,
useInsertionEffect,
useLayoutEffect,
useDebugValue,
useReducer,
useRef,
useState,
useSyncExternalStore,
useTransition,
startTransition,
lazy,
Suspense,
} from 'react';
Expand Down Expand Up @@ -151,16 +156,31 @@ export { useContext };
*/
export { useDebugValue };

/**
* @see https://reactjs.org/docs/hooks-reference.html#usedeferredvalue
*/
export { useDeferredValue };

/**
* @see https://reactjs.org/docs/hooks-reference.html#useeffect
*/
export { useEffect };

/**
* @see https://reactjs.org/docs/hooks-reference.html#useid
*/
export { useId };

/**
* @see https://reactjs.org/docs/hooks-reference.html#useimperativehandle
*/
export { useImperativeHandle };

/**
* @see https://reactjs.org/docs/hooks-reference.html#useinsertioneffect
*/
export { useInsertionEffect };

/**
* @see https://reactjs.org/docs/hooks-reference.html#uselayouteffect
*/
Expand Down Expand Up @@ -191,6 +211,16 @@ export { useState };
*/
export { useSyncExternalStore };

/**
* @see https://reactjs.org/docs/hooks-reference.html#usetransition
*/
export { useTransition };

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

/**
* @see https://reactjs.org/docs/react-api.html#reactlazy
*/
Expand Down

1 comment on commit c9555a7

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/3713137970
📝 Reported issues:

Please sign in to comment.