gatsby-plugin-modal-routing
gatsby-plugin-modal-routing copied to clipboard
Hooks not working inside modal - Most likely breaks my Context.Provider
I have my app wrapped with an Auth Context: `<authContext.Provider> ... </authContext.Provider>``
And then within my LoginPage (written as functional component) I'm using a custom useAuth hook to acess the current auth object and use its functions (e.g. login, signup, ...):
const auth = useAuth();
Following this example: https://usehooks.com/useAuth/
Problem:
When I open the page directly under its URL everything works. When opened in a modal the auth
object returned by useAuth()
is undefined.
Hi @mduecker sorry for the delay here. Is this still an issue for you? Could you share an example where this is reproduced?
I'll check if there's something obvious with hooks in general, but if you could share some code examples that would really help me track down your issue!