I started using react as my ui framework of choice. Upon my adventure through the documentation I noticed that when using the create-react-app
script to spin up a new react boilerplate, they used .js
file extension on scripts that where returning jsx
code. When I asked my buddy he told me that you should use the .jsx
extension on scripts that are returning this kind of code.
Im a bit lost here as if both works, wouldn't it just be better to go with the .js
extension as at the end of the day its javascript we writing.
Please help me with what is considered best practise. (I kinda have a feeling it would be to use the .jsx
extensions on these types of scripts, but I'd love to hear the community's view on this)
Thanks in advance :)