Temporary fix for dev docs while react-live is fixed (https://github.com/woocommerce/woocommerce-admin/pull/606)

* Temporary fix for dev docs while react-live is fixed

* Return null instead of th element
This commit is contained in:
Jonathan Belcher 2018-10-19 14:06:49 -04:00 committed by GitHub
parent 41536b35cb
commit 9d5e0dceb6
1 changed files with 5 additions and 1 deletions

View File

@ -4,7 +4,7 @@
*/
import codeBlocks from 'gfm-code-blocks';
import { Component } from '@wordpress/element';
import { LiveError, LivePreview, LiveProvider } from 'react-live';
// import { LiveError, LivePreview, LiveProvider } from 'react-live';
// Used to provide scope in LivePreview
import { addFilter } from '@wordpress/hooks';
import { withState } from '@wordpress/compose';
@ -43,6 +43,7 @@ class Example extends Component {
}
render() {
/*eslint-disable */
const { code } = this.state;
const scope = {
...wpComponents,
@ -55,6 +56,8 @@ class Example extends Component {
Gridicon,
};
return null;
return code ? (
<LiveProvider
code={ code }
@ -66,6 +69,7 @@ class Example extends Component {
<LivePreview />
</LiveProvider>
) : null;
/*eslint-enable */
}
}