From 436d2a29fb861782822ca0586b142665d226ea6c Mon Sep 17 00:00:00 2001 From: ykforerlang <1527997464@qq.com> Date: Wed, 11 Dec 2019 19:39:12 +0800 Subject: [PATCH] =?UTF-8?q?perf(alita):=20=E7=A7=BB=E9=99=A4=20=E7=94=B1?= =?UTF-8?q?=E4=BA=8E=20RN=20bable=20=E5=A4=84=E7=90=86=E4=BA=A7=E7=94=9F?= =?UTF-8?q?=E7=9A=84=E5=A4=9A=E4=BD=99=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/wx-react/package.json | 2 +- packages/wx-react/src/createElement.js | 6 ++++-- packages/wx-react/src/render.js | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/wx-react/package.json b/packages/wx-react/package.json index 75e0fa3..889ce9a 100644 --- a/packages/wx-react/package.json +++ b/packages/wx-react/package.json @@ -1,6 +1,6 @@ { "name": "@areslabs/wx-react", - "version": "2.0.0-beta.4", + "version": "2.0.0-beta.5", "description": "微信版本的React", "files": [ "package.json", diff --git a/packages/wx-react/src/createElement.js b/packages/wx-react/src/createElement.js index e852d02..0524cf6 100644 --- a/packages/wx-react/src/createElement.js +++ b/packages/wx-react/src/createElement.js @@ -11,7 +11,7 @@ const TmpKey = "HOCKEY" export default function createElement(comp, props, ...args) { if (!comp) { - console.error(`组件为${comp}, 是否忘记导入??`) + console.error(`${props.__source.fileName} 文件存在 , 其中XX为undefined!请排查`) return } @@ -29,7 +29,7 @@ export default function createElement(comp, props, ...args) { } } - const {animation, ref, key, tempName, tempVnode, CPTVnode, datakey, diuu, ...rprops} = props || {} + const {animation, ref, key, tempName, tempVnode, CPTVnode, datakey, diuu, __source, ...rprops} = props || {} // 通用的不支持属性 if (props.onLayout) { @@ -81,5 +81,7 @@ export default function createElement(comp, props, ...args) { tempVnode, CPTVnode, datakey, + + __source, // add by RN babel presets } } diff --git a/packages/wx-react/src/render.js b/packages/wx-react/src/render.js index 7fe5d11..9eb1a34 100644 --- a/packages/wx-react/src/render.js +++ b/packages/wx-react/src/render.js @@ -138,6 +138,8 @@ export default function render(vnode, parentInst, parentContext, data, oldData, updateRNBaseComponent(vnode, parentInst, parentContext, data, oldData, dataPath) } else if (typeof nodeName === 'function') { updateClassComponent(vnode, parentInst, parentContext, data, oldData, dataPath) + } else { + console.error(`${vnode.__source.fileName} 存在形式 其中XX是${vnode.nodeName}!请排查`) } } catch (e) { console.error(e)