gatsby-plugin-modal-routing icon indicating copy to clipboard operation
gatsby-plugin-modal-routing copied to clipboard

Hooks not working inside modal - Most likely breaks my Context.Provider

Open mduecker opened this issue 5 years ago • 1 comments

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.

mduecker avatar Sep 10 '19 11:09 mduecker

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!

lsirivong avatar Nov 03 '19 21:11 lsirivong