Skip to content

Commit 61f35c5

Browse files
authored
fix: remove unnecessary useState in code examples (#5879)
Update referencing-values-with-refs.md
1 parent 84810c5 commit 61f35c5

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/content/learn/referencing-values-with-refs.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -479,8 +479,6 @@ The last timeout ID variable is shared between all `DebouncedButton` components.
479479
<Sandpack>
480480

481481
```js
482-
import { useState } from 'react';
483-
484482
let timeoutID;
485483

486484
function DebouncedButton({ onClick, children }) {
@@ -532,7 +530,7 @@ A variable like `timeoutID` is shared between all components. This is why clicki
532530
<Sandpack>
533531

534532
```js
535-
import { useState, useRef } from 'react';
533+
import { useRef } from 'react';
536534

537535
function DebouncedButton({ onClick, children }) {
538536
const timeoutRef = useRef(null);

0 commit comments

Comments
 (0)