我目前正在使用
React Router DOM v 6.8.1
和 history v 5.3.0
我只是按照这个例子
但是在尝试使用
history
到 HistoryRouter
时出现 TS 错误
<HistoryRouter history={history}>
// code
</HistoryRouter>
Type 'BrowserHistory' is missing the following properties from type 'History': createURL, encodeLocationts(2739)
这是codesandbox 上的示例