Hello there, I am currently attempting to implement the following code snippet in my TypeScript-based class component:
this.history.push({
pathname: `/search-results`,
search: `${job}$${location}`
})
Unfortunately, I am running into an error that states: Property 'history' does not exist on type 'Banner'. TS2339
I have seen examples of how this can be achieved using functional components by utilizing const history = useHistory();
and then using history.push from the hook.
My question is: How can I achieve the same functionality in a class component?