Browse Source

tweak wording

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

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

@ -57,7 +57,9 @@ However, this is not perfect:
* Because JSX compiled into `React.createElement`, `React` needed to be in scope if you use JSX.
* There are some [performance improvements and simplifications](https://github.com/reactjs/rfcs/blob/createlement-rfc/text/0000-create-element-changes.md#motivation) that `React.createElement` does not allow.
To solve these issues, React 17 introduces two new entry points to the React package that are intended to only be used by compilers like Babel and TypeScript. Instead of transforming JSX to `React.createElement`, **the new JSX transform** automatically imports special functions from those new entry points in the React package and calls them. For example,
To solve these issues, React 17 introduces two new entry points to the React package that are intended to only be used by compilers like Babel and TypeScript. Instead of transforming JSX to `React.createElement`, **the new JSX transform** automatically imports special functions from those new entry points in the React package and calls them.
Let's say that your source code looks like this:
```js
function App() {
@ -65,7 +67,7 @@ function App() {
}
```
will now be transformed to
This is what the new JSX transform compiles it to:
```js
// Inserted by a compiler (don't import it yourself!)

Loading…
Cancel
Save