Skip to content

Commit

Permalink
Element: Add isEmptyElement utility function (#9681)
Browse files Browse the repository at this point in the history
* Element: Add isEmptyElement utility function

* Docs: Update changelog file for the element packages
  • Loading branch information
gziolo authored and aduth committed Sep 12, 2018
1 parent 71f3f04 commit 7af6f28
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
13 changes: 7 additions & 6 deletions packages/components/src/slot-fill/slot.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ import {
/**
* WordPress dependencies
*/
import { Component, Children, cloneElement, Fragment } from '@wordpress/element';

/**
* Internal dependencies
*/
import { isEmptyElement } from './utils';
import {
Children,
Component,
cloneElement,
Fragment,
isEmptyElement,
} from '@wordpress/element';

class Slot extends Component {
constructor() {
Expand Down
4 changes: 4 additions & 0 deletions packages/element/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.1.0 (Unreleased)

- New API method `isEmptyElement` was introduced ([9861](https://github.com/WordPress/gutenberg/pull/9681/)).

## 2.0.0 (2018-09-05)

### Breaking Change
Expand Down
1 change: 1 addition & 0 deletions packages/element/src/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export * from './react';
export * from './react-platform';
export * from './utils';
export { default as renderToString } from './serialize';
export { default as RawHTML } from './raw-html';
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
/**
* WordPress dependencies
*/
import { createElement } from '@wordpress/element';

/**
* Internal dependencies
*/
import { createElement } from '../react';
import { isEmptyElement } from '../utils';

describe( 'isEmptyElement', () => {
Expand Down
File renamed without changes.

0 comments on commit 7af6f28

Please sign in to comment.