Something really confuses me when I work at React.
React
There are many examples of using files .json the Internet, .jsxbut many others use files .jsx.
.js
.jsx
I read about files .jsxand I understand that they just let you write HTML tags in yours javascript. But the same thing can be written to files .js.
javascript
So what is the difference between these two extensions .jsand .jsx?
No file extensions. Your transmitter / transporter / no matter how you decide what type of file content is.
, .js .jsx. JSX JavaScript, , , "" JavaScript, , .. .jsx JSX .ts TypeScript .
.ts
/, JSX, JS! , JS JSX.
- javascript, JSX JS. Theyre !
/ JSX JS - , JS .
JSX- (<Component/>) javascript , <script>, . , React, , JSX, JS.
<Component/>
<script>
, React .js .jsx, React. .jsx. JSX .jsx.
, , , , JSX.
: .
, JSX javascript, .jsx, - , , HTML-, , ul> li
<ul> <li></li> </ul>
JSX JavaScript, Airbnb 'eslint'
// filename: MyComponent.js function MyComponent() { return <div />; }
as a warning, if you named your file MyComponent.jsx, it will go away, unless you edit the eslint rule, you can check the style guide here
Source: https://habr.com/ru/post/1685505/More articles:In mobile mode, we want to display the bottom of the div of each div - jqueryКогда нужно предпочесть ссылку const lvalue на шаблоны ссылок rvalue - c++Is there any way to ask IntelliJ IDEA to skip indexing some specific jar files added as a library? - intellij-ideaЗапрос на услугу с отключением: sns_main.c - c.net core 2.0 ConfigureLogging xunit test - c #CQRS: class redundancy and domain DTO transfer - c #https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1685507/how-to-use-multiple-pointers-to-an-object-by-vectormap&usg=ALkJrhgHz6baq0ugycfTqMgtuysfUMYzkwC ++ Grouping repetitions in Vector - c ++Duplicated http request in ionic 2 with asynchronous tube - angularPostman sees more cookies than python request - pythonAll Articles