'Error in HOC Typescript props (Type 'Omit<PropsWithChildren<T>, "children" | "className">' is not assignable to type 'IntrinsicAttributes)

I'm trying to correctly type in HOC, but I'm getting an error:

'Type 'Omit<PropsWithChildren<T>, "children" | "className">' is not assignable to type 'IntrinsicAttributes'

I can't understand why this is happening, because in fact my component should accept props of any kind

What am I doing wrong?

https://codesandbox.io/s/modern-dawn-ytt8ir?file=/src/WithCaption.tsx



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source