민프

[React][TypeScript] typeScript 셋업하기 본문

[React]

[React][TypeScript] typeScript 셋업하기

민프야 2023. 1. 24. 11:07
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----------
Comments