IntrinsicAttributes Error for Invalid Props
<Button onClick={() => setX(true)}>X</Button>
Type '{ children: ReactNode; onClick: () => void; }' is not assignable to type 'IntrinsicAttributes & RefAttributes<any> & Pick<RefAttributes<any>, never> & { theme?: object | undefined; } & { ...; }'.
Property 'onClick' does not exist on type 'IntrinsicAttributes & RefAttributes<any> & Pick<RefAttributes<any>, never> & { theme?: object | undefined; } & { ...; }'.
This is suggesting that your props are not validating in TypeScript.
Property 'onClick' does not exist on type 'IntrinsicAttributes...
Setting the props types on the React Component for the invalid props should resolve this.