TS2440
Import declaration conflicts with local declaration of 'React'.
Broken Code ❌
import React from 'react';
declare module React {
type MyCustomType<P> = void;
}Fixed Code ✔️
You cannot redeclare a module that you are importing, but you can outsource your additional typings to a declaration file in order to apply declaration merging:
declare namespace React {
type MyCustomType<P> = void;
}