Link options
linkOptions
는 객체 리터럴을 타입 검증하여 Link
, navigate
, 또는 redirect
에서 사용될 수 있도록 돕는 함수입니다.
linkOptions props
linkOptions
는 다음 옵션을 받습니다:
...props
- 타입:
LinkProps & React.RefAttributes<HTMLAnchorElement>
LinkProps
linkOptions
returns
입력값에서 정확히 추론된 타입을 가진 객체 리터럴을 반환합니다.
Examples
const userLinkOptions = linkOptions({
to: "/dashboard/users/user",
search: {
usersView: {
sortBy: "email",
filterBy: "filter",
},
userId: 0,
},
});
function DashboardComponent() {
return <Link {...userLinkOptions} />;
}