When I run 'npm start' of Demo 2 I got this error, however I do the same with the Demo 1 it can work well:
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 TS2786
11 | return (
12 | <span className={`svg-icon ${className}`}>
> 13 | <SVG src={toAbsoluteUrl(path)} className={svgClassName} />
| ^
14 | </span>
15 | )
16 | }
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.