ReferenceError.无法找到变量:uuid 找不到变量:uuid
在我的react native项目中,当我使用了 uuidv4
包。我是这样导入到我的文件中的。
import 'react-native-get-random-values';
import {uuid} from 'uuidv4';
驳回错误后,应用程序工作正常,uuids正在生成。只有在构建应用程序后才会出现错误
你可以试试uuid(https:/www.npmjs.compackageuuid)包,可以这样使用。
import { v4 as uuidv4 } from 'uuid';
uuidv4();