-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Closed
Description
import { useParams } from "react-router-dom"
interface JobPageRouteParams {
jobId: string
}
const MyComponent = () => {
const { jobId } = useParams<JobPageRouteParams>();
}gives an error: Type 'JobPageRouteParams' does not satisfy the constraint 'string'. .
The definition on useParams is
export declare function useParams<Key extends string = string>(): Readonly<Params<Key>>;which means that the generic type is supposed to be a string?? Am I missing something here?
phquang98, vitalik-prog, Coolfeather2, predragnikolic, TrejGun and 16 moreavinoamsnjafin and avinoamsn
Metadata
Metadata
Assignees
Labels
No labels