how do i set the focus method on a button after a page is closed
i got into one issue which becomes difficult to solve for me. i was working on the create new note page to make it accessible by moving the focus to the create new note button after the user closes the create new note page by clicking either go back or cancel button. no matter i tried i couldn't make the button focussable.
The steps which i followed was. i created a focus context and declare a ref variable for the create new note button and i created setFocus method which focuses the button and i pass those ref variable to the createnewnotepagebuttoncontext (a component where i pass the ref to the create new note button), (second i pass the setFocus method to all notes page to call it inside the useEffect. i also pass the state using navigate method from the create new note page using a state object to all notes page so we can check the value inside that state object to call the setFocus method inside allnotes page but all of these things doesn't work for me. could you see it guys?