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

wp.element - export lazy and Suspense #14412

Merged
merged 20 commits into from
Mar 26, 2019
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions packages/element/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,14 @@ Checks if an object is a valid WPElement

`boolean`: true if objectToTest is a valid WPElement and false otherwise.

### lazy

[src/index.js#L1-L1](src/index.js#L1-L1)

**Related**

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

### RawHTML

[src/index.js#L5-L5](src/index.js#L5-L5)
Expand Down Expand Up @@ -289,6 +297,14 @@ Serializes a React element to string.

Component that activates additional checks and warnings for its descendants.

### Suspense

[src/index.js#L1-L1](src/index.js#L1-L1)

**Related**

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

### switchChildrenNodeName

[src/index.js#L1-L1](src/index.js#L1-L1)
Expand Down
12 changes: 12 additions & 0 deletions packages/element/src/react.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import {
useImperativeHandle,
useLayoutEffect,
useDebugValue,
lazy,
Suspense,
} from 'react';
import { isString } from 'lodash';

Expand Down Expand Up @@ -159,6 +161,16 @@ export { useRef };
*/
export { useState };

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

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

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