dee*_*yal 1 uuid android ios react-native
在 React 本机项目 uuid 库中给出运行时错误
错误:不支持 crypto.getRandomValues()。请参阅 https://github.com/uuidjs/uuid#getrandomvalues-not-supported
“不支持 getRandomValues()”
在不支持标准 crypto.getRandomValues() API 的环境中会发生此错误。这个问题可以通过添加适当的polyfill来解决:
反应本机
Install react-native-get-random-values
Import it before uuid:
import 'react-native-get-random-values';
import { v4 as uuidv4 } from 'uuid';
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2786 次 |
| 最近记录: |