I read an article about JSX in React
I realized the advantages of JSX…
But I don’t know what is the difference between files that are in .jsx format and files that are in .js format?
Welcome to the community!
Here is something I found to explain the difference.
I hope it answers your question for you.
So the reason for having
.jsx as a file extension is that a tool doesn’t have to go through all your files: it can just look for those with the
.jsx extension and rewrite them to be plain
.js, that’s all. Makes things easier for the computer. It’s for simple and dumb reasons.
It’s not just tools that convert the files for the end product: it means that tools in text editors for highlighting code or looking for errors are much easier to build, because, again, they don’t have to check every file, just the ones ending in