小编Moh*_*iya的帖子

Nanoid不能用于react-native

我不知道当我在 React Native 中使用nanoid包时到底发生了什么,它显示了某种以下错误。我不确定。

\n

我希望有人能从这个社区得到帮助。

\n

提前致谢。

\n

场景:我只是导入到 nanoid 包中。

\n
import { nanoid } from 'nanoid';\n
Run Code Online (Sandbox Code Playgroud)\n
Error: React Native does not have a built-in secure random generator. If you don\xe2\x80\x99t need unpredictable IDs use `nanoid/non-secure`. For secure IDs, import `react-native-get-random-values` before Nano ID.    \nat node_modules\\react-native\\Libraries\\LogBox\\LogBox.js:148:8 in registerError\nat node_modules\\react-native\\Libraries\\LogBox\\LogBox.js:59:8 in errorImpl\nat node_modules\\react-native\\Libraries\\LogBox\\LogBox.js:33:4 in console.error\nat node_modules\\expo\\build\\environment\\react-native-logs.fx.js:27:4 in error\nat node_modules\\react-native\\Libraries\\Core\\ExceptionsManager.js:104:6 in reportException\nat node_modules\\react-native\\Libraries\\Core\\ExceptionsManager.js:171:19 in handleException\nat node_modules\\react-native\\Libraries\\Core\\setUpErrorHandling.js:24:6 in handleError\nat node_modules\\react-native\\Libraries\\polyfills\\error-guard.js:49:36 in ErrorUtils.reportFatalError   \nat node_modules\\metro\\src\\lib\\polyfills\\require.js:204:6 in guardedLoadModule\nat http://192.168.43.19:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false&minify=false:203661:3 in …
Run Code Online (Sandbox Code Playgroud)

react-native nanoid

7
推荐指数
2
解决办法
6587
查看次数

标签 统计

nanoid ×1

react-native ×1