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 | 31 |
Tags
- i 태그
- br 태그
- 아두이노
- not 의사클래스
- 전체 선택자
- html
- height속성
- go live
- Checked 의사 클래스
- 인접 형제 결합자
- reveal in file explorer
- 임베디드
- RGB
- RGBA
- width속성
- html tag i
- tag html
- 자식결합자
- iframe 태그
- id 선택자
- html 태그
- css
- Live Server
- background-color 속성
- sup태그
- padding 속성
- 일반 형제 결합자
- focus 의사클래스
- sub태그
- iframe
Archives
- Today
- Total
so woon!
[STYLED COMPONENTS] styled-components project 본문
학습일 : 2023. 03. 27
새로운 리액트 프로젝트를 생성하며
이번에는 Styled-component 를 사용해보고자 한다.
시작!
<create-react-app 설치 + 프로젝트 생성 + 깃허브 연동>
cmd 창에 npx create-react-app 만들프로젝트명 입력
(만약 이미 만들어진 폴더 안에서 cra를 설치해주고 싶다면 터미널에 바로 npx create-react-app . 명령어를 실행하면 된다)
생성된 프로젝트 폴더를 찾고 VSC에서 열어줌
F1 -> gitclone 클릭 -> 깃허브에 미리 만들어 놓은 repo 클릭해서 연동
<필요없는 파일 + 필요없는 코드 지우기>
App.js, index.js 빼고 파일을 다 지워준다 (src 폴더 내에 있는 파일만)
파일 속 필요없는 코드를 지워 주면 아래와 같다.
<index.js>
import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './App';
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
<React.StrictMode>
<App />
</React.StrictMode>
);
<App.js>
function App() {
return null;
}
export default App;
<styled-components 설치>
터미널에 npm i styled-components 엔터
하면 설치가 완료된다
-준비 끝-
'Styled Components > 개념정리' 카테고리의 다른 글
[STYLED COMPONENTS] styled 안 target 처리하기 (0) | 2023.03.28 |
---|---|
[STYLED COMPONENTS] animation (0) | 2023.03.28 |
[STYLED COMPONENTS] as 를 사용하여 element 교체하기 (0) | 2023.03.28 |
[STYLED COMPONENTS] 컴포넌트 확장하기 (0) | 2023.03.27 |
[STYLED COMPONENTS] styled-components 사용하기 (0) | 2023.03.27 |
Comments