Match-id-828470ed83600ad2ecbcc72bc70abde3c559ce5c
This commit is contained in:
commit
568e3ec531
|
@ -1,3 +1,6 @@
|
|||
## 0.0.42 (2023-03-24)
|
||||
- **core**: 解决直接通过defineProperty赋值vtype,enumerable为false,导致vtype为空问题
|
||||
|
||||
## 0.0.41 (2023-03-15)
|
||||
- **core**: #105 redux + forwardRef组合使用场景会报错,redux获取组件类型不对
|
||||
- **core**: 增加jsx-dev-runtime文件,给vite使用
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
"keywords": [
|
||||
"horizon"
|
||||
],
|
||||
"version": "0.0.41",
|
||||
"version": "0.0.42",
|
||||
"homepage": "",
|
||||
"bugs": "",
|
||||
"main": "index.js",
|
||||
|
|
|
@ -17,6 +17,7 @@ import {TYPE_FORWARD_REF, TYPE_MEMO} from '../../external/JSXElementType';
|
|||
|
||||
export function forwardRef(render: Function) {
|
||||
const forwardRefJSXElement = {
|
||||
vtype: TYPE_FORWARD_REF,
|
||||
$$typeof: TYPE_FORWARD_REF, // 规避三方件hoist-non-react-statics中,通过$$typeof获取类型,但获取不到,导致render被覆盖
|
||||
render,
|
||||
};
|
||||
|
@ -25,7 +26,6 @@ export function forwardRef(render: Function) {
|
|||
Object.defineProperty(forwardRefJSXElement, 'vtype', {
|
||||
configurable: false,
|
||||
writable: false,
|
||||
value: TYPE_FORWARD_REF,
|
||||
});
|
||||
|
||||
return forwardRefJSXElement;
|
||||
|
|
|
@ -17,6 +17,7 @@ import { TYPE_MEMO } from '../../external/JSXElementType';
|
|||
|
||||
export function memo<Props>(type, compare?: (oldProps: Props, newProps: Props) => boolean) {
|
||||
const memoJSXElement = {
|
||||
vtype: TYPE_MEMO,
|
||||
$$typeof: TYPE_MEMO, // 规避三方件hoist-non-react-statics中,通过$$typeof获取类型,但获取不到,导致type被覆盖
|
||||
type: type,
|
||||
compare: compare === undefined ? null : compare,
|
||||
|
@ -26,7 +27,6 @@ export function memo<Props>(type, compare?: (oldProps: Props, newProps: Props) =
|
|||
Object.defineProperty(memoJSXElement, 'vtype', {
|
||||
configurable: false,
|
||||
writable: false,
|
||||
value: TYPE_MEMO,
|
||||
});
|
||||
|
||||
return memoJSXElement;
|
||||
|
|
Loading…
Reference in New Issue