diff --git a/content/docs/refs-and-the-dom.md b/content/docs/refs-and-the-dom.md index 9653b64a..fd8f5832 100644 --- a/content/docs/refs-and-the-dom.md +++ b/content/docs/refs-and-the-dom.md @@ -168,8 +168,8 @@ You can, however, **use the `ref` attribute inside a function component** as lon ```javascript{2,3,6,13} function CustomTextInput(props) { // textInput must be declared here so the ref can refer to it - let textInput = useRef(null); - + const textInput = useRef(null); + function handleClick() { textInput.current.focus(); }