1

I am new in react-native. I would like to create a project in react-native with VS code. I know how to init a project with command ``react-native init ProjectName```but when this create this a java .js not .tsx. for example my project has app.js not app.tsx! how to create this? how to change it? thanks

1
  • The very first page in the official React Native environment setup guide specifies exactly how to do this. It's a good idea to at least try reading the documentation before asking questions.. reactnative.dev/docs/environment-setup Commented Sep 13, 2021 at 12:00

1 Answer 1

3

You have to define the template as typescript. init new project using below command

npx react-native init MyApp --template react-native-template-typescript

You can found the complete decumantation here

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

1 Comment

heads up for anyone who want to use this template: it is deprecated since Jan 2023. Typescript is first class in RN 0.71, read this

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.