Z
Z
zlodiak2020-11-28 15:45:16
typescript
zlodiak, 2020-11-28 15:45:16

How to type the history object?

I added a historymethod to the object push(),

history.push = (route: any) => {
    history.pushState(null, null, route);
    someAction();
}

now the typescript compiler underlines the line with this method in red. Please tell me, is it possible somehow to type historyso that the code is without underscores?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question