Match-id-828470ed83600ad2ecbcc72bc70abde3c559ce5c

This commit is contained in:
* 2023-03-24 17:28:50 +08:00
commit 568e3ec531
4 changed files with 6 additions and 3 deletions

View File

@ -1,3 +1,6 @@
## 0.0.42 (2023-03-24)
- **core**: 解决直接通过defineProperty赋值vtypeenumerable为false导致vtype为空问题
## 0.0.41 (2023-03-15)
- **core**: #105 redux + forwardRef组合使用场景会报错redux获取组件类型不对
- **core**: 增加jsx-dev-runtime文件给vite使用

View File

@ -4,7 +4,7 @@
"keywords": [
"horizon"
],
"version": "0.0.41",
"version": "0.0.42",
"homepage": "",
"bugs": "",
"main": "index.js",

View File

@ -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;

View File

@ -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;