Skip to content

Commit 986b905

Browse files
docs: use const for useRef click counter example
1 parent 2da4f7f commit 986b905

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/content/reference/react/useRef.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ This component uses a ref to keep track of how many times the button was clicked
112112
import { useRef } from 'react';
113113

114114
export default function Counter() {
115-
let ref = useRef(0);
115+
const ref = useRef(0);
116116

117117
function handleClick() {
118118
ref.current = ref.current + 1;

0 commit comments

Comments
 (0)