diff --git a/packages/next/cms/hooks/useFocus.js b/packages/next/cms/hooks/useFocus.js index 08024de62..ccd8549c6 100644 --- a/packages/next/cms/hooks/useFocus.js +++ b/packages/next/cms/hooks/useFocus.js @@ -1,10 +1,10 @@ -import {useRef} from "react"; +import {useCallback, useRef} from "react"; const useFocus = () => { const htmlElRef = useRef(null); - const setFocus = () => { + const setFocus = useCallback(() => { if (htmlElRef.current) htmlElRef.current.focus(); - }; + }, []); return [htmlElRef, setFocus]; };