gpt4 book ai didi

react-native - Reanimated 2 未能创建 worklet — 也许您忘记添加 Reanimated 的 babel 插件?

转载 作者:行者123 更新时间:2023-12-05 03:26:28 25 4
gpt4 key购买 nike

我已尽我所能来修复此错误。我尝试卸载 reanimated-bottom-sheet 和 react-native-reanimated 并重新安装它们。清除缓存。我不知道要编辑的 babel.config.js 文件。我知道错误来自下面这个确切的导入。

import BottomSheet from 'reanimated-bottom-sheet';

我还链接了一个存储库以重现我的确切问题 here .我添加了我的 node_modules 以防万一,我不确定它是否会帮助别人看到我做错了什么。

最佳答案

您需要在项目的根目录(靠近 package.json)中添加 babel.config.js 并使用以下上下文(或者从 https://github.com/software-mansion-labs/reanimated-2-playground 中获取它):

module.exports = {
presets: ['module:metro-react-native-babel-preset'],
plugins: [
'react-native-reanimated/plugin',
],
};

检查重新激活的文档 https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation/

关于react-native - Reanimated 2 未能创建 worklet — 也许您忘记添加 Reanimated 的 babel 插件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71722068/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com