lsirivong / gatsby-plugin-modal-routing

A gatsby plugin for routable modals
44 stars 30 forks source link

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

Open mduecker opened 5 years ago

mduecker commented 5 years ago

I have my app wrapped with an Auth Context: ` ... </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.

lsirivong commented 4 years ago

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!