I am trying to push an checkbox Object in Formik, but it is not working. I have taken reference from https://codesandbox.io/s/formik-example-forked-owodd?file=/index.js
but I want to push object inside initialValue.
Below is my way of doing it
{userManagement.map((permissions) => (
<li className="col-sm-3 col-xs-6" key={permissions.task}>
<label className="checkbox">
<input
name="permission"
type="checkbox"
value={permissions}
onBlur={(e) => {
if (e.currentTarget.checked) {
push({ permission: permissions });
console.log(values.permission);
} else {
const idx = values.permission.indexOf(permissions.value);
remove(idx);
}
}}
/>
<span />
{permissions.label}
</label>
</li>
))}