【发布时间】:2021-04-26 11:27:59
【问题描述】:
我有一个使用 react-native CLI 制作的应用,我的 RN 版本是 0.63,我收到了令人讨厌的 moment.js 警告,如下所示:
Require cycle: node_modules\moment\src\lib\create\local.js -> node_modules\moment\src\lib\create\from-anything.js -> node_modules\moment\src\lib\create\from-string-and-array.js -> node_modules\moment\src\lib\create\from-string-and-format.js -> node_modules\moment\src\lib\create\from-array.js -> node_modules\moment\src\lib\create\local.js
我正在尝试让它通过使用 LogBox 忽略此警告,但它不起作用。
我在我的 App.js 文件中这样做:
import { LogBox } from 'react-native';
LogBox.ignoreLogs(['Require cycle:']);
知道如何让它如此 react-native 会忽略警告吗?
【问题讨论】:
-
你找到解决办法了吗?
标签: javascript reactjs react-native