Home > Net >  why react native project is creating in typescript ? i want app.js
why react native project is creating in typescript ? i want app.js

Time:01-18

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

CodePudding user response:

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

CodePudding user response:

Unless I'm wrong, npx react-native init your-project-name creates a JS project by default.

  • Related