Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can create-react-app be used with TypeScript

Is it possible to use TypeScript with create-react-app? If so, how would you do it?

like image 412
Dave Ford Avatar asked Apr 18 '17 16:04

Dave Ford


People also ask

Does create React app work with TypeScript?

If you're building a new app and using create-react-app , the docs are great: You can start a new TypeScript app using templates. To use our provided TypeScript template, append --template typescript to the creation command.

Which command you will use to create a React app with TypeScript language?

Invoke the create-react-app command with an additional TypeScript option to generate a React application using TypeScript as the default JS syntax.

Is React coded with TypeScript?

Yes, TypeScript can work with React and webpack. Lucky for you, the webpack documentation has a guide on that.


1 Answers

You can do it like this:

create-react-app my-app --scripts-version=react-scripts-ts 

See https://github.com/wmonk/create-react-app-typescript

No ejecting required for this.

like image 160
levito Avatar answered Sep 19 '22 22:09

levito