Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- Java
- DB
- MacOS
- DATAPATH
- XML
- Algorithm
- while
- system
- react
- control
- web
- CSS
- php
- python
- function
- DS
- data structure
- Linux
- DoM
- instruction
- github
- for
- Class
- architecture
- MIPS
- html
- computer
- Pipelining
- mysql
- javascript
Archives
- Today
- Total
YYYEJI
[React] yarn으로 styled-components 설치하기 본문
728x90

Styled-components란?
id나 class를 사용하지 않고 동일한 컴포넌트에서 컴포넌트 이름을 쓰듯 스타일을 지정할 수 있으며,
React 프레임워크를 대상으로 하는 CSS-in-JS 라이브러리 중 하나입니다.
① yarn 설치
$ npm install -g yarn
styled-components를 설치하기 전에 yarn을 먼저 설치해줍니다.
② styled-components 설치
npm install --save styled-components
다음으로 styled-components를 설치합니다.
③ 파일 import
import styledComponents from 'styled-components';
styled-components를 적용하고 싶으면 파일을 import 해줍니다.
◡̈
'Web Application Server (WAS)' 카테고리의 다른 글
[React] Failed to load plugin 'jest' declared in 'package.json 에러 (0) | 2023.01.11 |
---|---|
[API KEY] 카카오 API 키 발급 받는 방법 (0) | 2023.01.11 |
[React] JSX 태그 내부에서 변수 사용하기 (0) | 2023.01.10 |
[React] 리액트(React)에서 이미지 넣기 (0) | 2023.01.10 |
[React] JSX expressions must have one parent element 에러 (0) | 2023.01.10 |