Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why `npx react-native init` command creates typescript project? [duplicate]

I'm beginner for react native i'm creating a React Native Project using React native CLI but project is creating with app.ts i want to create project in javascript version.

i have tried react native official docs to create React native Project

like image 553
Rajkumar Pandey Avatar asked Aug 27 '26 20:08

Rajkumar Pandey


1 Answers

TypeScript is a language which extends JavaScript by adding type definitions. New React Native projects target TypeScript by default, but also support JavaScript and Flow.

Files with a .jsx / .js extension are treated as JavaScript instead of TypeScript, and will not be type checked.

So you can simply use JavaScript instead of TypeScript by changing extension from .tsx/.ts to .jsx/.js and also you may remove type annotations if any is there in your JavaScript files.

Ref : Using JavaScript Instead of TypeScript

like image 57
Thanhal Avatar answered Aug 29 '26 10:08

Thanhal



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!