Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

Commit

Permalink
fix: remove unnecessary useState in code examples (#5879)
Browse files Browse the repository at this point in the history
Update referencing-values-with-refs.md
  • Loading branch information
escwxyz authored Apr 7, 2023
1 parent 84810c5 commit 61f35c5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/content/learn/referencing-values-with-refs.md
Original file line number Diff line number Diff line change
Expand Up @@ -479,8 +479,6 @@ The last timeout ID variable is shared between all `DebouncedButton` components.
<Sandpack>

```js
import { useState } from 'react';

let timeoutID;

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

```js
import { useState, useRef } from 'react';
import { useRef } from 'react';

function DebouncedButton({ onClick, children }) {
const timeoutRef = useRef(null);
Expand Down

0 comments on commit 61f35c5

Please sign in to comment.