Skip to content

[Bug]: Framework codegen produces invalid types when using absolute child route paths #12359

@fenok

Description

@fenok

What version of React Router are you using?

7.0.1

Steps to Reproduce

In an app that uses React Router as a framework (I used create-react-router@latest), define routes like this:

export default [route('/:a', 'routes/page.tsx', [route('/:a/:b', 'routes/subpage.tsx')])] satisfies RouteConfig;

In real life, paths are built by a separate tool, and this approach is more convenient.

Expected Behavior

import type { Route } from "./+types/subpage";

// Should be { a: string; b: string }
type Params = Route.MetaArgs['params'];

Actual Behavior

import type { Route } from "./+types/subpage";

// Actually it's { a: [ string, string ]; b: string }
type Params = Route.MetaArgs['params'];

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions