react-navigation/drawerのcreateDrawerNavigator()を使用した時のエラー対応を備忘する
■エラーメッセージ
"Error: Reanimated 2 failed to create a worklet, maybe you forgot to add Reanimated's babel plugin"
■対応手順
1.babel.config.jsに【plugins: ["react-native-reanimated/plugin"]】を追記する。
[babel.config.js]
-----
module.exports = function (api) {
api.cache(true);
return {
presets: ["babel-preset-expo"],
plugins: ["react-native-reanimated/plugin"],
};
};
-----
2.[expo start -c]コマンドを実行する
■参考サイト
https://www.youtube.com/watch?v=Ad0LUwCytu4&ab_channel=LahoreGraphicsAcademy
0 件のコメント:
コメントを投稿