Browse Source

Clarify

main
Dan Abramov 4 years ago
parent
commit
4e4ba15bab
  1. 8
      content/blog/2020-09-22-introducing-the-new-jsx-transform.md

8
content/blog/2020-09-22-introducing-the-new-jsx-transform.md

@ -28,7 +28,7 @@ Now let's take a closer look at the differences between the old and the new tran
When you use JSX, the compiler transforms it into React function calls that the browser can understand. **The old JSX transform** turned JSX into `React.createElement(...)` calls.
For example,
For example, let's say your source code looks like this:
```js
import React from 'react';
@ -38,7 +38,7 @@ function App() {
}
```
gets transformed to
Under the hood, the old JSX transform turns it into regular JavaScript:
```js
import React from 'react';
@ -48,6 +48,10 @@ function App() {
}
```
>Note
>
>**Your source code doesn't need to change in any way.** We're describing how the JSX transform turns your JSX source code into the JavaScript code a browser can understand.
However, this is not perfect:
* Because JSX compiled into `React.createElement`, `React` needed to be in scope if you use JSX.

Loading…
Cancel
Save