You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I haven't done much custom hook writing but as far as I know the main difference between a regular function and a custom hook is that a custom hook lets you call other hooks inside it.
also to use a custom hook you have to call it at the top level in a component, so you would need to return something from the custom hook.
This would actually be handy for the logout function, converting it to a hook allows us to call the useHistory() directly, and return a function that uses history.push().
I haven't done much custom hook writing but as far as I know the main difference between a regular function and a custom hook is that a custom hook lets you call other hooks inside it.
also to use a custom hook you have to call it at the top level in a component, so you would need to return something from the custom hook.
This would actually be handy for the logout function, converting it to a hook allows us to call the useHistory() directly, and return a function that uses history.push().
to use this, you would have to call useLogout inside Sidebar
This is an alternative to what i suggested in #16
The text was updated successfully, but these errors were encountered: