You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, i'm using gatsby here. I found out that the toggle didn't work well with <input>onChange. It requires 2 clicks for state changes. This behaviour occurs when we reload the page with darkMode.valuetrue
Here is the component
import*asReactfrom'react';importuseDarkModefrom'use-dark-mode';constDarkmodeToggle=()=>{const{ toggle, value }=useDarkMode(false)return(<div><label><inputtype="checkbox"checked={value}onChange={toggle}/></label></div>)}exportdefaultDarkmodeToggle
anyone here have the same issue?
The text was updated successfully, but these errors were encountered:
Hi, i'm using gatsby here. I found out that the
toggle
didn't work well with<input>
onChange
. It requires 2 clicks for state changes. This behaviour occurs when we reload the page withdarkMode.value
true
Here is the component
anyone here have the same issue?
The text was updated successfully, but these errors were encountered: