I got a route which may have different syntax according to the tokenid
<Switch>
<Route exact path="/">
<HomePageComponent />
</Route>
<Route path="/verify/:tokenId" component={EmailTarget}>
</Switch>
What i am trying to do is i am trying to grab what is in the place of :tokenId.
Here what code look like inside the Email Target Component.
const EmailTarget: React.FC = ( props ) => {
const [ loginState, setLoginState ] = useState('');
useEffect(() => {
console.log(props.match.params.tokenId)
}, [])
What I am doing now is simply console logging the tokenId. But the typescript is giving me error.
Here is the error log
C:/Users/kerry/Desktop/works/rslabs/src/components/EmailTarget.tsx
TypeScript error in C:/Users/kerry/Desktop/works/rslabs/src/components/EmailTarget.tsx(14,27):
Property 'match' does not exist on type '{ children?: ReactNode; }'.
The strange thing about this situation is that I can console.log the tokenId and actually giving me the result but the program is giving me an error.
Please don't give minus to this question. If you give a minus please mention the area I need to improve in the question first.
RouteComponentProps