Switch not taking initialValue
The <Switch /> is not setting to active/checked when its formik initialValue is true.
Basic example here: https://codesandbox.io/s/formik-material-ui-switch-o5rns
Adding type=checkbox seems to fix it
You are right! Thank you.
Actually, the simple <Switch /> implementation with formik-material-ui works right with type="checkbox" prop. But I have some dynamic implementation for diferent data types.
Check this project now: https://codesandbox.io/s/formik-material-ui-switch2-05rbw, this way to render the <Switch /> is not working, even with type="checkbox".
The type still needs to be on the Field
<Field name="my_switch" type="checkbox">
{fieldProps => <Switch {...fieldProps} />}
</Field>