evans646 / React-and-Typescript

Working with React and Typescript Together

Repository from Github https://github.comevans646/React-and-TypescriptRepository from Github https://github.comevans646/React-and-Typescript

Getting started


  • Creating a react application with stypescript support using the create react app CLI
  • Comparing project output

we create by typing:

npx create-react-app appname --template typescript

Which creates the app configured with Ts

The ts config file contains the configuration of how ts can be used in the project

react Ts CLI options:

  • create-next-app
  • create-snowpack-app
  • gatsby

To add Typscript to existing app, you need to install and configure it within the app :

yarn add typescript @types/react @types/react-dom @types/node

after sintallation you can update the

.js files to have .ts extention eg. App.js => App.ts

after that :

yarn start

Or npm whichever you prefer

About

Working with React and Typescript Together


Languages

Language:TypeScript 43.8%Language:HTML 36.5%Language:CSS 19.7%