The issue with using onAuthorized within a component, such as in a useEffect, is that the client has to load the React library first, then start the mounting process, then the onAuthorized will be ran as useEffect takes place after mounting but prior to rendering (essentially componentDidMount in the component lifecycle).
What this means is that on slower systems, particularly mobile devices, it’s entirely possible for Twitch to fire the auth event before your component is mounted and your onAuthorized handler is run.
Just because it may appear to work for you does NOT mean that it will work for all users, and is bad React design, and just bad Extension design in general regardless of what libraries you are using to have onAuthorized run after other things are loaded and it is not recommended.