Could not find a declaration file for module 'react-dom/client'

Viewed 12

I have following error when use react-dom/client

Compiled with problems:X

ERROR in src/index.tsx:2:28

TS7016: Could not find a declaration file for module 'react-dom/client'. 'C:/Users/Mohamad/Desktop/HIS/Administration/Administration/Administration/Administration.Endpoints.WebUI/ClientApp/node_modules/react-dom/client.js' implicitly has an 'any' type.
  Try `npm install @types/react-dom` if it exists or add a new declaration (.d.ts) file containing `declare module 'react-dom/client';`
    1 | import * as React from 'react';
  > 2 | import { createRoot } from 'react-dom/client';
      |                            ^^^^^^^^^^^^^^^^^^
    3 | import App from './App';
    4 |
    5 |
0 Answers
Related