개발공부일지
[Project] - React + TypeScript + Tailwind css 본문
https://tailwindcss.com/docs/installation/using-postcss
https://react.dev/learn/typescript
https://react-typescript-cheatsheet.netlify.app/docs/basic/setup
- 설치하기
npx create-react-app mini --template typescript
npm install @types/react @types/react-dom
npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p
- tailwind.config.js
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ['./src/**/*.{html,js,jsx,ts,tsx}'],
theme: {
extend: {},
},
plugins: [],
};
- postcss.config.js
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};
- index.css
@tailwind base;
@tailwind components;
@tailwind utilities;
- app.tsx
function App() {
return (
<div className="App">
<div className="w-60 h-60 bg-yellow-400">test!!!</div>
</div>
);
}
export default App;
'Project' 카테고리의 다른 글
[react-project] stacker labs (1) | 2024.01.03 |
---|---|
[react-project] socket.io로 실시간 채팅 구현하기 (2) | 2023.12.29 |
[react-project] input box 초기화 (0) | 2023.12.29 |
[react-project] Darkmode 만들기 (tailwind, recoil) (1) | 2023.12.22 |
[react-project] Search Bar 만들기 (0) | 2023.12.20 |