Thanks for the article. I've tried this solution, but stuck with an error:
Type 'string | null | undefined' is not assignable to type 'string | undefined'
<div className={className}
~~~~~~~~~
node_modules/@types/react/index.d.ts:1645:9
1645 className?: string;
I'm using React class component declaration and @types/react
Thanks for the article. I've tried this solution, but stuck with an error:
I'm using React class component declaration and @types/react
Without declaring className on propTypes it fails with an error
Property 'className' does not exist on type'Readonly<InferPropTypes<{...`What could be the reason for this?
Thanks for the question. Could you build a codesandbox example, so we can see the complete example and then try to fix it from there?
Sure, here it is codesandbox.io/s/weathered-snowfla...
Looks like If disable strict mode in tsconfig.json it works fine.
Excellent, thanks!
Will try it out and provide some feedback.