I'm using nextjs and when I click the switch this is the error I get:
Here's my code:
<label> <span>Switch with default style</span> <Switch onChange={handleChange(1)} checked={isActive(1)} /> </label>
It looks like you're invoking the handleChange function which means you're passing whatever that function returns to the Switch component. You should be passing the function itself.
I'm using nextjs and when I click the switch this is the error I get: Here's my code:
<label> <span>Switch with default style</span> <Switch onChange={handleChange(1)} checked={isActive(1)} /> </label>