Skip to content

Commit c44f4e5

Browse files
andys8Sunil Pai
andauthored
Use const for ref in functional component docs (#1129)
Co-authored-by: Sunil Pai <[email protected]>
1 parent 420fc31 commit c44f4e5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

content/docs/refs-and-the-dom.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ You can, however, **use the `ref` attribute inside a function component** as lon
168168
```javascript{2,3,6,13}
169169
function CustomTextInput(props) {
170170
// textInput must be declared here so the ref can refer to it
171-
let textInput = useRef(null);
172-
171+
const textInput = useRef(null);
172+
173173
function handleClick() {
174174
textInput.current.focus();
175175
}

0 commit comments

Comments
 (0)