Skip to content

Commit 18ac8f7

Browse files
authored
minor adjustments to the documentation (#3354)
1 parent 95894a1 commit 18ac8f7

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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,7 +192,7 @@ 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 beta](https://devblogs.microsoft.com/typescript/announcing-typescript-4-1-beta/#jsx-factories).
196196

197197
### Flow {#flow}
198198

@@ -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.

content/docs/reference-events.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ Properties:
146146
DOMEventTarget relatedTarget
147147
```
148148

149-
#### onFocus
149+
#### onFocus {#onfocus}
150150

151151
The `onFocus` event is called when the element (or some element inside of it) receives focus. For example, it's called when the user clicks on a text input.
152152

@@ -163,7 +163,7 @@ function Example() {
163163
}
164164
```
165165

166-
#### onBlur
166+
#### onBlur {#onblur}
167167

168168
The `onBlur` event handler is called when focus has left the element (or left some element inside of it). For example, it's called when the user clicks outside of a focused text input.
169169

@@ -180,7 +180,7 @@ function Example() {
180180
}
181181
```
182182

183-
#### Detecting Focus Entering and Leaving
183+
#### Detecting Focus Entering and Leaving {#detecting-focus-entering-and-leaving}
184184

185185
You can use the `currentTarget` and `relatedTarget` to differentiate if the focusing or blurring events originated from _outside_ of the parent element. Here is a demo you can copy and paste that shows how to detect focusing a child, focusing the element itself, and focus entering or leaving the whole subtree.
186186

@@ -219,7 +219,6 @@ function Example() {
219219
}
220220
```
221221

222-
223222
* * *
224223

225224
### Form Events {#form-events}

0 commit comments

Comments
 (0)