I am rewriting the project written in Javascript with Typescript. A type is requested in the state value sent to the link component and it throws an error. But I didn't know where to do this.
<S.Forgot>
<Link to={{ pathname: "/forgot", state: { type: "merchant" } }}>
Şifremi Unuttum
</Link>
</S.Forgot>
error
Type '{ pathname: string; state: { type: string; }; }' is not assignable to type 'To'.
Object literal may only specify known properties, and 'state' does not exist in type 'Partial<Path>'.ts(2322)
index.d.ts(53, 5): The expected type comes from property 'to' which is declared here on type 'IntrinsicAttributes & LinkProps & RefAttributes<HTMLAnchorElement>'