Solution found on Stackoverflow :
and here on Medium:
-
Create a new directory in nodes_modules/@types
-
Name it "leaflet-defaulticon-compatibility".
-
Create a new file named "index.d.ts".
Add this line :
declare module 'leaflet-defaulticon-compatibility';
Now you can import without errors in your file.tsx :
import "leaflet-defaulticon-compatibility";