Which packages are impacted?
What version of these packages are you using?
Please provide a link to a minimal reproduction of the issue.
https://codesandbox.io/p/devbox/musing-cloud-8sdzs2?file=%2Fsrc%2FApp.tsx%3A3%2C1-13%2C1&workspaceId=ws_RWcC4PWu4DCakowNKjeNug
Steps to Reproduce the Bug or Issue
import { zfd } from 'zod-form-data'
const validationSchema = zfd.formData({
isBoolean: zfd.checkbox(),
});
console.log(
validationSchema.parse({
isBoolean: true,
})
);
This results in the following error:
ZodError: [
{
"code": "invalid_union",
"errors": [
[
{
"code": "invalid_value",
"values": [
"on"
],
"path": [],
"message": "Invalid input: expected \"on\""
}
],
[
{
"code": "invalid_value",
"values": [
null
],
"path": [],
"message": "Invalid input: expected undefined"
}
]
],
"path": [
"isBoolean"
],
"message": "Invalid input"
}
]
Expected behavior
If I pass a boolean value to zfd.checkbox(), I expect it to pass validation.
Screenshots or Videos
No response
Platform
- OS: Windows 11
- Browser: Chrome, Firefox
Additional context
No response
Which packages are impacted?
@rvf/react@rvf/react-router@rvf/zod@rvf/yupzod-form-dataWhat version of these packages are you using?
Please provide a link to a minimal reproduction of the issue.
https://codesandbox.io/p/devbox/musing-cloud-8sdzs2?file=%2Fsrc%2FApp.tsx%3A3%2C1-13%2C1&workspaceId=ws_RWcC4PWu4DCakowNKjeNug
Steps to Reproduce the Bug or Issue
This results in the following error:
Expected behavior
If I pass a boolean value to
zfd.checkbox(), I expect it to pass validation.Screenshots or Videos
No response
Platform
Additional context
No response