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
I ended up creating my own checkbox by copying this repo and modifying it to fit my needs.
One of the issues I had was with including useMergedState in my module.... this seems to be an export issue with the rc-util package not being developed for ESM.
My solution was to get rid of useMergedState entirely. The alternative was actually quite simple - useEffect and useState combined: -
Activity
U-4-E-A commentedon Feb 26, 2024
I ended up creating my own checkbox by copying this repo and modifying it to fit my needs.
One of the issues I had was with including
useMergedStatein my module.... this seems to be an export issue with therc-utilpackage not being developed for ESM.My solution was to get rid of
useMergedStateentirely. The alternative was actually quite simple -useEffectanduseStatecombined: -const [isChecked, setIsChecked] = useState<boolean>(false)Then I can just use the state
isCheckedas normal (whererawValuewould have been used).I created a test harness of all possibilities and it passed: -
All elements displayed and behaved as expected.
Although I am considering moving the
defaultCheckedoption to force this to be a controlled component (personal preference).