민프
[React][TypeScript] typeScript 셋업하기 본문
1. npx create-react-app 내 앱 이름 --template typescript
2. npm i --save-dev @types/styled-components
3. npm i styled-components
4. App.js, index.js 내용 수정
----------index.js----------
import React from "react";
import ReactDOM from "react-dom";
import App from "./App";
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById("root")
);
// 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
----------index.js----------
----------App.js----------
function App() {
return (
<div>
</div>
);
}
export default App
----------App.js----------
'[React]' 카테고리의 다른 글
[React][TypeScript] optional props를 적용해보자 (feat. ?) (0) | 2023.01.25 |
---|---|
[React][TypeScript] type Props 적용해보기 (with interface, required props) (0) | 2023.01.24 |
[React][TypeScript] typeScript 이란? (0) | 2023.01.23 |
[React] Style Components - 5 다크모드, 라이트모드 (Themes) (0) | 2023.01.23 |
[React] Styled Component - 4 animation(keyframes), styled 컴포넌트 안의 다른 element 선택 적용 (0) | 2023.01.23 |
Comments