daisyui / react-daisyui

daisyUI components built with React 🌼
http://react.daisyui.com/
MIT License
943 stars 103 forks source link

useTheme not respecting the default option #292

Closed taivo closed 1 year ago

taivo commented 1 year ago

It looks like useTheme always sets the theme to 'light' instead of the arg passed to it. I've replicated the issue here: https://playcode.io/1076138

Note that even though I called the hook with const { theme, setTheme } = useTheme('synthwave') , the variable theme stays as light

Am I using this wrong somehow? Lmk. Thanks!

taivo commented 1 year ago

I just browsed through the code and it looks like I did use it wrong. is the context provider so it must wrap any component that calls useTheme which in turn calls useContext