Route parameters returning undefined for a specific route param in Remix.run

95 Views Asked by At

My route file structure looks like this.

In my loader of industries.$slug.tsx

export async function loader({ params }: LoaderFunctionArgs) {
    console.log(JSON.stringify(params))
    return {}
}

When I'm at industries/big-data console.log(JSON.stringify(params)) shows {"slug":"big-data"}.

But when I'm at industries/ai console.log(JSON.stringify(params)) shows {"slug":"undefined"}. What even is this?

0

There are 0 best solutions below