Closed marksmall closed 2 years ago
Hey @marksmall . I forgot to mention that we have to link the packages in order to run the demo project. In root and in demo
folders you have to run npm link react
. The error Error: Invalid hook call.
is thrown because without npm link
we end up with two react libraries in the bundle and this is not allowed.
Once you toggle the theme, you should be able to see the cookie in Application tab with remix-themes
key.
Example:
Please let me know if you managed to start the demo.
That's great@abreghici, in fairness, I should have thought of that myself, but didn't, for others that don't know, or just plain stupid like myself, it might be worth putting steps into the demo's README. Cheers for the help and I can confirm it did work after following those steps.
@marksmall Happy to help! I'll update the README with these steps. Good catch!
Hi there,
I have this working on a personal app, following the README, but I cannot see any cookie. I therefore tried to get the demo app to run so as to compare and am having some trouble. I
npm install && npm run build
in the repo rootnpm install && npm run dev
in the demo directoryThe app starts, but I get the following error:
I looked at the index.tsx file and the hook is called within the body of the function, so I'm a bit confused. Any help would be appreciated.
What I really want to understand is why I cannot see any cookie in my browser, representing the theme, as I want to read this cookie on each subsequent visit to the app and have it's value applied.