React 새로운 파일 만들기
1. 터미널 npx create-react-app 폴더명
2. public에서 index.html 빼고 파일 지우기
3. src에서 App.js, index.js, index.css 빼고 지우기
Tailwind 설치하기
- 'Get started' 클릭
- 'Create React App' 클릭
터미널 :
1. cd 폴더명
2. npm install -D tailwind
3. npx tailwind init
4. content: ["./src/**/*.{js,jsx,ts,tsx}",] 삽입
@tailwind base;
@tailwind components;
@tailwind utilities;
5. <index.css>에 해당 코드 넣기
6. 해당 코드 삽입
export default function App() {
return (
<h1 className="text-3xl font-bold underline">
Hello world!
</h1>
)
}
import reportWebVitals from './reportWebVitals';
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
7. 삭제하기
8. npm start
'IT 공부 > React-Tailwind' 카테고리의 다른 글
[Tailwind Css] alert박스 만들기(p, max-w, mx-auto) (0) | 2023.07.02 |
---|---|
React-Tailwind를 이용하여 캐러셀(carousel) 만들기 (1) | 2023.04.15 |
3. navigate로 다른 페이지 이동 (0) | 2023.04.13 |
1. 버튼 만들기(transition + hover) (0) | 2023.04.11 |
JavaScript 문법 - array/object의 값을 수정하고 싶을때 (0) | 2023.04.05 |