What is the correct way to type and use the className prop in a custom component? I used to be able to do this:
class MyComponent extends React.Component<MyProps, {}> {
...
}
and then use my component via:
<MyComponent className="my-class" />
Note that I would not define className in MyProps, though React was previously typed to support this usage.
Now, I am now seeing this type error:
Property 'className' does not exist on type 'IntrinsicAttributes &
IntrinsicClassAttributes<Component<{}, ComponentState>> & Readonly<{
childr...'
What is the correct way to define / type my component that will allow me to use className when using my component?