I'm using Material UI Switches with Formik. Whenever I "enable" the switch it automatically marks the value in Formik as "true" and when I "disable" the switch it marks the value in Formik as "false".
I'm looking to invert the UI switch so when my Formik value is "true" the switch displays a "false" value. I've tried modifying the "checked" value on the switch to no avail, and I've started playing with the styling properties of the switch as well.
Any ideas would be appriciated, thanks!
What I understand is that you want to invert the behaviour of the switch component, so when the Formik value is true the switch should display false and vice versa.
If that's the case, why not just take the negative of the Formik value?
<Switch {...label} checked={!formikValue} onChange={handleChange} />
Here's a sandbox