Skip to content

Commit 7c8cd36

Browse files
meizilove258liujuping
authored andcommitted
fix: in ES require changed to import
1 parent 573504b commit 7c8cd36

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/renderer-core/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"@types/lodash": "^4.14.167",
4444
"@types/node": "^13.7.1",
4545
"@types/prop-types": "^15.7.3",
46+
"@types/react-is": "^17.0.3",
4647
"@types/react-test-renderer": "^17.0.1",
4748
"babel-jest": "^26.5.2",
4849
"build-plugin-component": "^0.2.11",

packages/renderer-core/src/utils/common.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,16 @@ import 'moment/locale/zh-cn';
88
import { isEmpty } from 'lodash';
99
import IntlMessageFormat from 'intl-messageformat';
1010
import pkg from '../../package.json';
11+
import * as ReactIs from 'react-is';
12+
import { default as ReactPropTypesSecret } from 'prop-types/lib/ReactPropTypesSecret';
13+
import { default as factoryWithTypeCheckers } from 'prop-types/factoryWithTypeCheckers';
1114

1215
export const moment = _moment;
1316
moment.locale('zh-cn');
1417
(window as any).sdkVersion = pkg.version;
1518

1619
export { pick, isEqualWith as deepEqual, cloneDeep as clone, isEmpty, throttle, debounce } from 'lodash';
1720

18-
const ReactIs = require('react-is');
19-
const ReactPropTypesSecret = require('prop-types/lib/ReactPropTypesSecret');
20-
const factoryWithTypeCheckers = require('prop-types/factoryWithTypeCheckers');
21-
2221
const PropTypes2 = factoryWithTypeCheckers(ReactIs.isElement, true);
2322

2423
const EXPRESSION_TYPE = {

0 commit comments

Comments
 (0)