Let's say I have an interface
interface Setting {
desc: string,
title: string,
value: string | number | boolean | number[] | float,
value_type: "string" | "integer" | "bool" | "list" | "float"
}
And a functional component that accepts two arguments
const SettingsOption = ({ ...option }: Setting, test: string): JSX.Element => {return (...)}
Such function signature seems fine to TypeScript compiler.
Next, I try to call the component using <SettingsOption {...option} test=""/> but it says
type '{ test: string; desc: string; title: string; value: string | number | boolean | number[]; value_type: "string" | "float" | "integer" | "bool" | "list"; }' is not assignable to type 'IntrinsicAttributes & Setting'.
Property 'test' does not exist on type 'IntrinsicAttributes & Setting'.ts(2322)
My question: is there a way to call such component with passing all necessary information?