We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Component
wrapFieldsWithMeta
The type returned from wrapFieldsWithMeta includes a form property:
form
tinacms/packages/tinacms/src/toolkit/fields/plugins/field-props.ts
Lines 4 to 8 in 18c674b
However, the Component type does not expect this property:
tinacms/packages/@tinacms/schema-tools/src/types/index.ts
Lines 10 to 33 in 18c674b
Reproduction:
import { wrapFieldsWithMeta, type Collection } from 'tinacms'; export const myCollection: Collection = { label: 'Docs', name: 'doc', path: 'docs', format: 'mdx', fields: [ { name: 'body', type: 'string', label: 'Doc Content', required: true, isBody: true, ui: { component: wrapFieldsWithMeta((props) => <input />), // ^^^ Property 'form' is missing on `component` expected type, but included on `wrapFieldsWithMeta` return type }, }, ], };
Yields this TypeScript error:
Property 'form' is missing in type '{ field: TinaField & { namespace: string[]; }; input: { name: string; onBlur: (event?: FocusEvent<string, Element> | undefined) => void; onChange: (event: ChangeEvent<...>) => void; onFocus: (event?: FocusEvent<...> | undefined) => void; type?: string | undefined; value: string[]; }; meta: Meta; }' but required in type 'FieldProps<TinaField & { namespace: string[]; }>'.
Type '(props: InputFieldType<{ field: TinaField<false> & { namespace: string[]; }; input: { name: string; onBlur: (event?: FocusEvent<string, Element> | undefined) => void; onChange: (event: ChangeEvent<...>) => void; onFocus: (event?: FocusEvent<...> | undefined) => void; type?: string | undefined; value: string; }; meta...' is not assignable to type 'string | Component<string, true> | null | undefined'. Type '(props: InputFieldType<{ field: TinaField<false> & { namespace: string[]; }; input: { name: string; onBlur: (event?: FocusEvent<string, Element> | undefined) => void; onChange: (event: ChangeEvent<...>) => void; onFocus: (event?: FocusEvent<...> | undefined) => void; type?: string | undefined; value: string; }; meta...' is not assignable to type 'Component<string, true>'. Types of parameters 'props' and 'props' are incompatible. Type '{ field: TinaField<false> & { namespace: string[]; }; input: { name: string; onBlur: (event?: FocusEvent<string, Element> | undefined) => void; onChange: (event: ChangeEvent<...>) => void; onFocus: (event?: FocusEvent<...> | undefined) => void; type?: string | undefined; value: string[]; }; meta: Meta; }' is not assignable to type 'InputFieldType<{ field: TinaField<false> & { namespace: string[]; }; input: { name: string; onBlur: (event?: FocusEvent<string, Element> | undefined) => void; onChange: (event: ChangeEvent<...>) => void; onFocus: (event?: FocusEvent<...> | undefined) => void; type?: string | undefined; value: string; }; meta: Meta; ...'. Property 'form' is missing in type '{ field: TinaField<false> & { namespace: string[]; }; input: { name: string; onBlur: (event?: FocusEvent<string, Element> | undefined) => void; onChange: (event: ChangeEvent<...>) => void; onFocus: (event?: FocusEvent<...> | undefined) => void; type?: string | undefined; value: string[]; }; meta: Meta; }' but required in type 'FieldProps<TinaField<false> & { namespace: string[]; }>'.
See description for a simple repro
No response
`"tinacms": "^1.6.3",` `"typescript": "^5.4.2",`
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the issue that you're seeing. Any Loom videos or screenshots usually help a lot!
The type returned from
wrapFieldsWithMeta
includes aform
property:tinacms/packages/tinacms/src/toolkit/fields/plugins/field-props.ts
Lines 4 to 8 in 18c674b
However, the
Component
type does not expect this property:tinacms/packages/@tinacms/schema-tools/src/types/index.ts
Lines 10 to 33 in 18c674b
Reproduction:
Yields this TypeScript error:
Complete TypeError:
Reproduction
See description for a simple repro
Steps to reproduce
No response
System Info
Validations
The text was updated successfully, but these errors were encountered: