LoginSignup
2
1

More than 5 years have passed since last update.

React-Native@0.57.0でstyled-components@4.0.0が使えない時の対処法

Last updated at Posted at 2018-10-17

2日程前に styled-components@4.0.0がリリースされました。

react-native@0.57.0 環境化(もしかしたら 0.57.0 だけじゃないかも?)で試すとエラーが発生する。

これらのエラーを解消するには

supports-color をインストールすると解決する。

yarn add supports-color --dev

これで自分の環境では問題無く使えるようになった。

余談

具体的な問題は不明だけど、react-native@0.57.0rn-cli.config の破壊的変更があったけど、 metro bundlerが一枚嚙んでいるんじゃないかと思う。
あと、react-native周りはこういう突然使えなくなる系が多い気がする。大抵は関連するライブラリのissueを読み込めば解決策が見つかるけど、それでもこういうのに引っかかると面喰らってしまうのは僕だけだろうか、、、

現場からは以上です。

参考
https://github.com/styled-components/styled-components/issues/2044

2
1
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
2
1