'how to define types of userRouteMatch instance properly in react-typescript component
using useRouteMatch in component below, it works fine except typescript compile error
import { useRouteMatch } from 'react-router-dom'
export const ResultsScreen = observer(() => {
const { params } = useRouteMatch()
..
return(
params.history ? 'Back' : 'Next'
this line marked with ts error:
Property 'history' does not exist on type 'match<{}>'.
dont want to use //@ts-ignore here, how to put ts types properly?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
