[Metronic8 - React] App start typescript 'cannot be used as a JSX component' error
When I run 'npm start' of <strong>Demo 2</strong> I got this error, however I do the same with the <strong>Demo 1</strong> it can work well:
<blockquote> TypeScript error in /src/_metronic/helpers/components/KTSVG.tsx(13,8): 'SVG' cannot be used as a JSX component. Its instance type 'InlineSVG' is not a valid JSX element. The types returned by 'render()' are incompatible between these types. Type 'React.ReactNode' is not assignable to type 'import("/node_modules/react-intl/node_modules/@types/react/index").ReactNode'. Type '{}' is not assignable to type 'ReactNode'. Type '{}' is missing the following properties from type 'ReactPortal': key, children, type, props TS278611 | return (
12 | <span className={`svg-icon ${className}`}>
</blockquote>13 | <SVG src={toAbsoluteUrl(path)} className={svgClassName} /> | ^ 14 | </span> 15 | )<blockquote></blockquote> 16 | }
Replies (1)
After hours searching, I've found the solution in this post
"Bug in import from react-inlinesvg"
Thanks Mr. Harold Hugh, Mr. Carmelo D and Mr. Nirav Shah (who post the question).
I do not know how to delete this question so I replied my own question.