Skip to content

Commit 64da1ae

Browse files
committed
remove whitespace changes
1 parent beaab2a commit 64da1ae

File tree

2 files changed

+30
-30
lines changed

2 files changed

+30
-30
lines changed

src/content/learn/manipulating-the-dom-with-refs.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -165,27 +165,27 @@ export default function CatFriends() {
165165

166166
```css
167167
div {
168-
width: 100%;
169-
overflow: hidden;
168+
width: 100%;
169+
overflow: hidden;
170170
}
171171

172172
nav {
173-
text-align: center;
173+
text-align: center;
174174
}
175175

176176
button {
177-
margin: .25rem;
177+
margin: .25rem;
178178
}
179179

180180
ul,
181181
li {
182-
list-style: none;
183-
white-space: nowrap;
182+
list-style: none;
183+
white-space: nowrap;
184184
}
185185

186186
li {
187-
display: inline;
188-
padding: 0.5rem;
187+
display: inline;
188+
padding: 0.5rem;
189189
}
190190
```
191191

@@ -285,27 +285,27 @@ function setupCatList() {
285285

286286
```css
287287
div {
288-
width: 100%;
289-
overflow: hidden;
288+
width: 100%;
289+
overflow: hidden;
290290
}
291291

292292
nav {
293-
text-align: center;
293+
text-align: center;
294294
}
295295

296296
button {
297-
margin: .25rem;
297+
margin: .25rem;
298298
}
299299

300300
ul,
301301
li {
302-
list-style: none;
303-
white-space: nowrap;
302+
list-style: none;
303+
white-space: nowrap;
304304
}
305305

306306
li {
307-
display: inline;
308-
padding: 0.5rem;
307+
display: inline;
308+
padding: 0.5rem;
309309
}
310310
```
311311

src/content/reference/react/useRef.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import { useRef } from 'react';
2828
function MyComponent() {
2929
const intervalRef = useRef(0);
3030
const inputRef = useRef(null);
31-
// ...
31+
// ...
3232
```
3333
3434
[See more examples below.](#usage)
@@ -65,7 +65,7 @@ import { useRef } from 'react';
6565

6666
function Stopwatch() {
6767
const intervalRef = useRef(0);
68-
// ...
68+
// ...
6969
```
7070
7171
`useRef` returns a <CodeStep step={1}>ref object</CodeStep> with a single <CodeStep step={2}>`current` property</CodeStep> initially set to the <CodeStep step={3}>initial value</CodeStep> you provided.
@@ -245,22 +245,22 @@ import { useRef } from 'react';
245245

246246
function MyComponent() {
247247
const inputRef = useRef(null);
248-
// ...
248+
// ...
249249
```
250250
251251
Then pass your ref object as the `ref` attribute to the JSX of the DOM node you want to manipulate:
252252
253253
```js [[1, 2, "inputRef"]]
254254
// ...
255-
return <input ref={inputRef} />;
255+
return <input ref={inputRef} />;
256256
```
257257
258258
After React creates the DOM node and puts it on the screen, React will set the <CodeStep step={2}>`current` property</CodeStep> of your ref object to that DOM node. Now you can access the `<input>`'s DOM node and call methods like [`focus()`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus):
259259
260260
```js [[2, 2, "inputRef.current"]]
261261
function handleClick() {
262-
inputRef.current.focus();
263-
}
262+
inputRef.current.focus();
263+
}
264264
```
265265
266266
React will set the `current` property back to `null` when the node is removed from the screen.
@@ -365,27 +365,27 @@ export default function CatFriends() {
365365
366366
```css
367367
div {
368-
width: 100%;
369-
overflow: hidden;
368+
width: 100%;
369+
overflow: hidden;
370370
}
371371

372372
nav {
373-
text-align: center;
373+
text-align: center;
374374
}
375375

376376
button {
377-
margin: .25rem;
377+
margin: .25rem;
378378
}
379379

380380
ul,
381381
li {
382-
list-style: none;
383-
white-space: nowrap;
382+
list-style: none;
383+
white-space: nowrap;
384384
}
385385

386386
li {
387-
display: inline;
388-
padding: 0.5rem;
387+
display: inline;
388+
padding: 0.5rem;
389389
}
390390
```
391391

0 commit comments

Comments
 (0)