-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use .jsx extension for JSX files instead of .js #52
Comments
+1 to avoid confusion |
+1 |
+1 editors syntax highlighting |
+1 |
Components in the starter kit currently use
Do you think that the benefits of having |
I prefer the use of |
good point |
Every .css file is valid SCSS, but a .scss file may not be valid CSS |
FWIW a relevant discussion on this in the React repo: |
jsx isn't valid javascript so, it should not use a .js extension |
@ehartford JSX it's just an extension to JavaScript, not a new language like TypeScript or CoffeeScript. Can you tell the same about |
@koistya JSX adds new syntax to ES just as TS does, they're both extensions/supersets that don't follow the ES spec or any stage'd proposal. FWIW |
Irrelevant. JSX syntax can be used (and it is) in every javascript source file. Closing |
@langpavel What about Facebook deprecating react-tools (last comment on facebook/react#832) and recommending .jsx extension? @koistya You're confused.
See the 2 keywords here: As a newcomer to the React World, finding jsx syntax inside js is misleading. Everyone here's telling you it's confusing. You do as you please but you're going against your community, that's not really user-centric approach. |
facebook is recommending using .jsx extension how is this an invalid issue? |
@ehartford Do you have a link for that, because the link PixnBits posted is React saying not to use |
Create react app does not use jsx too |
@ehartford |
If that's so, how come no browser will interpret a JSX <script> unless its 'type' attribute is specified as 'text/babel' (which will tell Babel to interpret it) rather than 'text/javascript' ? |
As of React 0.12, it is recommended to use the .jsx file extension rather than the pragma in .js files.
This will also help with editors doing syntax highlighting & linting.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: