Notice
Recent Posts
Recent Comments
Link
250x250
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
Tags
- python
- DS
- javascript
- control
- web
- system
- XML
- DB
- github
- html
- AI
- react
- instruction
- MIPS
- data structure
- architecture
- DATAPATH
- Linux
- Pipelining
- CSS
- mysql
- Algorithm
- computer
- for
- Java
- Class
- openai
- function
- Rag
- php
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 해줍니다.
◡̈
728x90
'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 |