6

I recently tried to crate a new react native app by using the `

npx react-native@latest init AwesomeProject

` command but it created a folder with a app.tsx file.

How can I force it to create a app.js instead? Or can I just replace it with a javascript file? I can't find an awnser to this so hopefully someone can help me.

Greetings

Ben

1

2 Answers 2

10

React native of >=0.71 version considers Typescript as default. You can change the .tsx file to the .js file by changing the file extension and deleting the typescript codes from the file.

But react-native <=0.70 version still considers JavaScript as default. To install react native of <=0.70 you can use the following command on CLI:

npx react-native init <project_name> --version 0.70

Here you can write the version you want.

Official Reference: Using JavaScript Instead of TypeScript

Sign up to request clarification or add additional context in comments.

Comments

1

npx create-expo-app firstapp --template blank

1 Comment

Questioner asking about react native. Expo is different.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.