reactjs - react native : Module RCTLog is not a re

我制作了一个 React Native 包并发布在 npm 上。

问题是当我在 React Native 应用程序中将代码作为普通组件运行时,它工作正常,没有错误。

当我在 Npm 上发布包并将其作为依赖项下载到我的项目时,应用程序抛出红屏错误。

错误是:

Invariant Violation: Module RCTLog is not a registered callable module (calling logIfNoNativeHook)

__callFunction
    index.bundle?platform=ios&dev=true&minify=false:109413:18
<unknown>
    index.bundle?platform=ios&dev=true&minify=false:109128:31
__guard
    index.bundle?platform=ios&dev=true&minify=false:109369:15
callFunctionReturnFlushedQueue
    index.bundle?platform=ios&dev=true&minify=false:109127:21
callFunctionReturnFlushedQueue
    [native code]:0

Note: All the code available on Github and the package is available on Npm if you can install it and give me feedback if you get the same error of not also it can be helpful

最佳答案

原因大概是由于this .

我会尝试实现上述建议,基本上将此 var RCTLog = require('RCTLog'); 添加到 index.ios.js 文件中。

关于reactjs - react native : Module RCTLog is not a registered callable module (calling logIfNoNativeHook),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58240078/

相关文章:

asynchronous - 如何使 promise 因 clojure 错误而失败?

ruby-on-rails - 如何使用 Vue 前端和 Rails 后端实现 env 变量?是否需

reactjs - `react-dom` 是库还是框架?

spring-boot - 将实体与 OneToMany 和 HATEOAS RessourceAs

python - 如何理解 4x4 混淆矩阵?

azure - 服务主体帐户本地 AD Connect 同步

cmake - 安装问题: Cmake error : include could not find

oauth-2.0 - 松弛 Oauth : Automatically authorize use

python - 如何使用 Pandas 计算数据框中的类标签频率?

haskell - Cabal/Stack 忽略自定义安装脚本的 ghc-options