Closed the-code-raccoon closed 1 month ago
Hi @the-code-raccoon - try either
ObjectField
ObjectField
type from your titleField
, which will let TS infer the typeExample for 1
export const titleField: ObjectField<{ title: string; subtext: string }> = {
type: 'object',
objectFields: {
text: {
type: 'text',
},
subtext: {
type: 'text',
},
},
}
Background
Current Behaviour
I have two components
A
andB
. I want them both to have a title rendered with some settings (ex. text alignment, text size, etc). So I created a function as follows in a separate file that both componentA
andB
can call.However when I assign
titleField
totitle
in the config for my components. I get the following type errorWith the following error
Please let me know if this isn't an issue and just an error on my end, thanks!