Is it possible to use TypeScript with create-react-app
? If so, how would you do it?
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.
Invoke the create-react-app command with an additional TypeScript option to generate a React application using TypeScript as the default JS syntax.
Yes, TypeScript can work with React and webpack. Lucky for you, the webpack documentation has a guide on that.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With