1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Reactでstyled-componentsが見つからない(not found)

Posted at

はじめに

この記事は2022年8月にまとめていた「細かいつまずいたことをメモしておく(8月編)をそれぞれ投稿した内容になります
解決方法が最新でない可能性もありますのでご了承ください

問題

React.js+TypeScriptの環境に以下の方法でstyled-componentsをいれたところ読み込み時に見つからないエラーがでた

$ yarn add styled-components
 could not find a declaration file for module 'styled-chttps://github.com/styled-components/styled-components/issues/2099omponents'

解決方法

TypeScriptは型ファイルが必要になるので以下のインストールをすると動くようになった

$ yarn add @types/styled-components

参考

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?