Don't directly import from React, use @wordpress/element. (https://github.com/woocommerce/woocommerce-admin/pull/4978)
This commit is contained in:
parent
2ca0182582
commit
5fbc511f25
|
@ -4,8 +4,7 @@
|
|||
import { __ } from '@wordpress/i18n';
|
||||
import { decodeEntities } from '@wordpress/html-entities';
|
||||
import { escapeRegExp } from 'lodash';
|
||||
import { Fragment } from '@wordpress/element';
|
||||
import { useEffect, useMemo, useState } from 'react';
|
||||
import { Fragment, useEffect, useMemo, useState } from '@wordpress/element';
|
||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
||||
import { SelectControl, TextControl } from '@woocommerce/components';
|
||||
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
/**
|
||||
* External dependencies
|
||||
*/
|
||||
import { Component } from '@wordpress/element';
|
||||
import React from 'react';
|
||||
import { Component, createElement } from '@wordpress/element';
|
||||
|
||||
class Example extends Component {
|
||||
state = {
|
||||
|
@ -28,7 +27,7 @@ class Example extends Component {
|
|||
}
|
||||
|
||||
this.setState( {
|
||||
example: React.createElement(
|
||||
example: createElement(
|
||||
exampleComponent.default || exampleComponent
|
||||
),
|
||||
} );
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
import { __ } from '@wordpress/i18n';
|
||||
import { compose } from '@wordpress/compose';
|
||||
import { Button } from '@wordpress/components';
|
||||
import { useState } from 'react';
|
||||
import { useState } from '@wordpress/element';
|
||||
import PropTypes from 'prop-types';
|
||||
import { withDispatch, withSelect } from '@wordpress/data';
|
||||
|
||||
|
|
Loading…
Reference in New Issue