Skip to content

Commit f7a6f9f

Browse files
Merge pull request #219 from reactjs/sync-7a11d71b
Sync with reactjs.org @ 7a11d71
2 parents 3c64336 + 32e1cbe commit f7a6f9f

36 files changed

Lines changed: 689 additions & 387 deletions

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,3 @@
1-
Note to Hacktoberfest 🎃 participants:
2-
3-
While we appreciate the enthusiasm, we are experiencing a high volume of drive-by pull requests (one-line changes, README tweaks, etc.). Please remember that hundreds of people are subscribed to this repo and will receive notifications for these PRs. Spam submissions will be closed and won't count towards your Hacktoberfest goals.
4-
5-
Please search for issues tagged [`good first issue`][gfi] or [`hacktoberfest`][hacktoberfest] to find things to work on.
6-
7-
You can also search [all of GitHub][all].
8-
9-
[gfi]: https://github.com/reactjs/reactjs.org/issues?q=is%3Aissue+is%3Aopen+label%3A"good+first+issue"
10-
[hacktoberfest]: https://github.com/reactjs/reactjs.org/issues?q=is%3Aissue+is%3Aopen+label%3A"good+first+issue"
11-
[all]: https://github.com/search?q=is%3Aissue+hacktoberfest
121
<!--
132
143
Thank you for the PR! Contributors like you keep React awesome!

content/authors.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ keyanzhang:
4949
kmeht:
5050
name: Kunal Mehta
5151
url: https://github.com/kmeht
52+
laurentan:
53+
name: Lauren Tan
54+
url: https://twitter.com/sugarpirate_
5255
LoukaN:
5356
name: Lou Husson
5457
url: https://twitter.com/loukan42

content/blog/2017-09-08-dom-attributes-in-react-16.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ In React 16, we are making a change. Now, any unknown attributes will end up in
2929
React has always provided a JavaScript-centric API to the DOM. Since React components often take both custom and DOM-related props, it makes sense for React to use the `camelCase` convention just like the DOM APIs:
3030

3131
```js
32-
<div tabIndex="-1" />
32+
<div tabIndex={-1} />
3333
```
3434

3535
This has not changed. However, the way we enforced it in the past forced us to maintain a whitelist of all valid React DOM attributes in the bundle:
@@ -55,10 +55,10 @@ With the new approach, both of these problems are solved. With React 16, you can
5555

5656
```js
5757
// Yes, please
58-
<div tabIndex="-1" />
58+
<div tabIndex={-1} />
5959

6060
// Warning: Invalid DOM property `tabindex`. Did you mean `tabIndex`?
61-
<div tabindex="-1" />
61+
<div tabindex={-1} />
6262
```
6363

6464
In other words, the way you use DOM components in React hasn't changed, but now you have some new capabilities.
@@ -120,7 +120,7 @@ Below is a detailed list of them.
120120
* **Known attributes with a different canonical React name:**
121121

122122
```js
123-
<div tabindex="-1" />
123+
<div tabindex={-1} />
124124
<div class="hi" />
125125
```
126126

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ Since the new JSX transform doesn't require React to be in scope, [we've also pr
9999

100100
### Create React App {#create-react-app}
101101

102-
Create React App support [has been added](https://github.com/facebook/create-react-app/pull/9645) and will be available in the [upcoming v4.0 release](https://gist.github.com/iansu/4fab7a9bfa5fa6ebc87a908c62f5340b) which is currently in beta testing.
102+
Create React App [4.0.0](https://github.com/facebook/create-react-app/releases/tag/v4.0.0)+ uses the new transform for compatible React versions.
103103

104104
### Next.js {#nextjs}
105105

@@ -143,7 +143,7 @@ npm update @babel/core @babel/preset-react
143143
yarn upgrade @babel/core @babel/preset-react
144144
```
145145

146-
Currently, the old transform (`"runtime": "classic"`) is the default option. To enable the new transform, you can pass `{"runtime": "automatic"}` as an option to `@babel/plugin-transform-react-jsx` or `@babel/preset-react`:
146+
Currently, the old transform `{"runtime": "classic"}` is the default option. To enable the new transform, you can pass `{"runtime": "automatic"}` as an option to `@babel/plugin-transform-react-jsx` or `@babel/preset-react`:
147147

148148
```js
149149
// If you are using @babel/preset-react
@@ -192,11 +192,11 @@ If you are using [eslint-plugin-react](https://github.com/yannickcr/eslint-plugi
192192

193193
### TypeScript {#typescript}
194194

195-
TypeScript supports the JSX transform in [v4.1 beta](https://devblogs.microsoft.com/typescript/announcing-typescript-4-1-beta/#jsx-factories).
195+
TypeScript supports the new JSX transform in [v4.1](https://devblogs.microsoft.com/typescript/announcing-typescript-4-1/#jsx-factories) and up.
196196

197197
### Flow {#flow}
198198

199-
Flow supports the new JSX transform in [v0.126.0](https://github.com/facebook/flow/releases/tag/v0.126.0) and up.
199+
Flow supports the new JSX transform in [v0.126.0](https://github.com/facebook/flow/releases/tag/v0.126.0) and up, by adding `react.runtime=automatic` to your Flow configuration options.
200200

201201
## Removing Unused React Imports {#removing-unused-react-imports}
202202

@@ -213,7 +213,6 @@ npx react-codemod update-react-imports
213213
>
214214
>Keep in mind that the codemod output will not always match your project's coding style, so you might want to run [Prettier](https://prettier.io/) after the codemod finishes for consistent formatting.
215215
216-
217216
Running this codemod will:
218217

219218
* Remove all unused React imports as a result of upgrading to the new JSX transform.

0 commit comments

Comments
 (0)