so after installing react native using npx react-native init MyProject
the project is running and open in emulator but the app file is not app.js instead app.tsx,
The question is i am new to react native and many tutorial i see is havgin App.js file, and the code in app.js is different between js and tsx at least that’s what i see, or is it just the same if i follow tutorial like folder structure, syntax and everything.
2
Answers
That’s because of this
Read Using JavaScript Instead of TypeScript
You can just rename your
tsx
tojsx
Well, I had the same concerrns earlier today while working on the current version 0.71. This version does not create a
App.js
file. What I did was- I created a fileApp.jsx
and added this code:it automatically renders the code in it instead of the default
App.tsx
fileYou can write your JavaScript code in the
Ap.jsx
file