New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FormMetadata
type mismatch
#406
Comments
It might be because we now have a basic FormContext type and a react version FormContext. Looked at the diff from For now, I think you can just use |
I added On this line:
TypeScript starts to check whether type I vaguely understand this is due to contravariance of function types, but I don't understand why it started happening when it did, nor do I know how to solve it. |
Getting the same error with FieldMetadata, looping through an array of objects. const Schema = z.object({
users: z.array(z.object({ name: z.string() })
})
const Component = () => {
const list = fields.users.getFieldList();
return (
<div>{list.map(l => <ListItem config={l} key={l.key} />}</div>
)
}
const ListItem = ({config}: {config: FieldMetadata<z.infer<typeof Schema>>}) => {
return null
} |
Describe the bug and the expected behavior
I have a component that takes
FormMetadata
as a prop. The form metadata I get fromuseForm()
is no longer compatible with theFormMetadata
type.The last working version was
v1.0.0-rc.0
. It looks like the problem was introduced inv1.0.0-rc.1
.Conform version
v1.0.0
Steps to Reproduce the Bug or Issue
https://stackblitz.com/edit/remix-run-remix-thrjv1?file=index.ts
What browsers are you seeing the problem on?
No response
Screenshots or Videos
No response
Additional context
I think it's possible something was missed in 465d1ba, but so far I haven't found it.
The text was updated successfully, but these errors were encountered: