TanStackT
TanStack11mo ago
1 reply
good-rose

Store links in an array

I'm trying to define a long list of links in an array for an onboarding flow so that I'm able to programmatically define a layout where you have the navigation to the left (list of links in order) and so that the layout automatically provides "previous" and "next" buttons for each step of the flow.

Is there a way to type:

const links: MysteryType = [
    { to: "/$lang/onboarding/a", params: { lang }},
    { to: "/$lang/onboarding/b", params: { lang }},
    // ...
];


and have it be typesafe?

I tried to use LinkProps but it seems to lose typesafety when used directly.
Was this page helpful?