Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dt~react-router error TS2503: Cannot find namespace 'HistoryModule'

I tried to download the React-Router typings definition using typings install --save --global dt~react-router, but my code will still not compile because the HistoryModule referenced by typings/globals/react-router/index.d.ts does not exist.

Earlier I was recommended to go with typings --save react-router, but although this includes the dreaded "HistoryModule", it is missing other key typing definitions for properties which the React Router elements typically have (missing onChange property of Route element props). Is there something else from typings that I need to download to get this to work? Also, how can I tell if I need to download multiple other global typings definitions to get a different one to work, because I'm not aware of any way and the typings command does not appear to understand if a global typing definition depends on other modules.

like image 744
Ozymandias Avatar asked Mar 12 '23 19:03

Ozymandias


1 Answers

from https://github.com/DefinitelyTyped/DefinitelyTyped/issues/9928

The CLI tells you that there's been references stripped, it is up to the user to make sure they get installed. This is because references are not an adequate dependency system. enter image description here
typings install dt~react-router/history --global

like image 118
Ozymandias Avatar answered Apr 30 '23 05:04

Ozymandias