import React from 'react'; import { useParams } from 'react-router-dom'; interface IParams { id: string; } export const MyRestaurant = () => { const { id } = useParams<IParams>(); return <h1>My Restaurant</h1>; } This is my code, and i just wanna get params but i got error message just like this..
Untyped function calls may not accept type arguments
What's the problem? Thank you
https://stackoverflow.com/questions/66083584/typescript-react-router-dom-useparams-error February 07, 2021 at 09:05AM
没有评论:
发表评论