We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8b501dc commit 9563042Copy full SHA for 9563042
exercises/04.file-upload/02.problem.file-validation/README.mdx
@@ -21,11 +21,7 @@ a snippet from that example:
21
22
```tsx
23
const schema = z.object({
24
- profile: z
25
- .instanceof(File)
26
- // When browser constructs a form data from an empty file input, a default file
27
- // entry would be created. we can validate this by checking the filename and size.
28
- .refine(file => file.name !== '' && file.size !== 0, 'Profile is required'),
+ profile: z.instanceof(File, { message: 'Profile is required' }),
29
})
30
```
31
0 commit comments