美文网首页
ReactNative分包加载JS报错this._lazyCal

ReactNative分包加载JS报错this._lazyCal

作者: Migaloo | 来源:发表于2017-08-01 21:40 被阅读0次

    ReactNative在0.45版本以后,包括0.45版本,对RN框架进行了修改,导致如果在加载框架代码之后,立刻加载业务代码会报错this._lazyCallableModules[e] is not a function. (In 'this._lazyCallableModules[e]()', 'this._lazyCallableModules[e]' is undefined)

    找了很久原因,其实也很简单,在RCTRootView.m文件里有一句话

    // Immediately schedule the application to be started.

    // (Sometimes actual `_bridge` is already batched bridge here.)

    [selfbundleFinishedLoading:([_bridgebatchedBridge] ?:_bridge)];

    看注释就很扯淡,�简单修改一下成

    if(!_bridge.loading)

    {

    [selfbundleFinishedLoading:([_bridgebatchedBridge] ?:_bridge)];

    }

    就这么简单。

    相关文章

      网友评论

          本文标题:ReactNative分包加载JS报错this._lazyCal

          本文链接:https://www.haomeiwen.com/subject/gyeslxtx.html