LoginSignup
11
12

More than 3 years have passed since last update.

react-navigationでreact-native-gesture-handler関連のエラーが出る

Last updated at Posted at 2019-08-30

どうやらexpo 34あたりからreact-native-gesture-handlerがインストールされなくなった?らしい(公式サイトにはそうは書いてないけど)。

なので、react-navigationを利用するためには、

npm install --save react-navigation

の後に、

npm install --save react-native-gesture-handler react-native-reanimated

とする必要があるようです。

expoだと、expo install react-native-gesture-handler react-native-reanimatedとするのがいいとここに書いてます。

ただ、インストールすると、expo start時に下記のようなエラーというかWarningがでる。

スクリーンショット 2019-08-31 9.08.44.png

どうやら、バージョンが合わないらしく、ダウングレードする必要があるらしい。
Warningやここのページに、

package.jsonの中の、記述を下記のように変更する必要がある。

"react-native-gesture-handler": "~1.3.0"
"react-native-reanimated": "~1.1.0",

その上で、

  1. node_modulesとpackage-lock.josnを一度削除して
  2. npm installを再実行
  3. そしてexpoを利用している場合、expo r -cとしてキャッシュをクリアしないと反映されない

以上。ほんとバージョン管理が大変。

11
12
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
12