Skip to content

Commit

Permalink
wp.element - export lazy and Suspense (#14412)
Browse files Browse the repository at this point in the history
* wp.element - export lazy and Suspense

* npm run docs:build

* cleanup

* docs build

* Update README

* add lazy & Suspence with links to react docs

* README from master

* npm run docs: build

* Update react.js

* Update README.md

* Update CHANGELOG.md
  • Loading branch information
Adam Silverstein authored and gziolo committed Mar 26, 2019
1 parent 57c2ab3 commit 186ce11
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
22 changes: 22 additions & 0 deletions packages/element/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
## 2.4.0 (Unreleased)

### New Features

- Added `lazy` feautre (see: https://reactjs.org/docs/react-api.html#reactlazy).
- Added `Suspense` component (see: https://reactjs.org/docs/react-api.html#reactsuspense).

## 2.3.0 (2019-03-06)

### New Features

- Added `useCallback` hook (see: https://reactjs.org/docs/hooks-reference.html#usecallback).
- Added `useContext` hook (see: https://reactjs.org/docs/hooks-reference.html#usecontext).
- Added `useDebugValue` hook (see: https://reactjs.org/docs/hooks-reference.html#usedebugvalue).
- Added `useEffect` hook (see: https://reactjs.org/docs/hooks-reference.html#useeffect).
- Added `useImperativeHandle` hook (see: https://reactjs.org/docs/hooks-reference.html#useimperativehandle).
- Added `useLayoutEffect` hook (see: https://reactjs.org/docs/hooks-reference.html#uselayouteffect).
- Added `useMemo` hook (see: https://reactjs.org/docs/hooks-reference.html#usememo).
- Added `useReducer` hook (see: https://reactjs.org/docs/hooks-reference.html#usereducer).
- Added `useRef` hook (see: https://reactjs.org/docs/hooks-reference.html#useref).
- Added `useState` hook (see: https://reactjs.org/docs/hooks-reference.html#usestate).

## 2.1.8 (2018-11-15)

## 2.1.7 (2018-11-09)
Expand Down
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

0 comments on commit 186ce11

Please sign in to comment.