Skip to content

Commit af9f63b

Browse files
committed
Update changeset
1 parent 4fac433 commit af9f63b

1 file changed

Lines changed: 24 additions & 1 deletion

File tree

.changeset/fix-redirect-guard-routing.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,27 @@
44

55
Fixed `redirectTo()` guard not working on modules/resources without a component. Index routes are now created for loader-only routes, enabling redirect guards to execute properly.
66

7-
Fixed sidebar navigation hiding modules/resources that use `redirectTo()` guards. Navigation filtering now only excludes `hidden()` guards, so redirect-guarded items remain visible in the sidebar.
7+
Fixed auto-generated sidebar navigation hiding modules/resources that use `redirectTo()` guards. Navigation filtering now only excludes `hidden()` guards, so redirect-guarded items remain visible in the sidebar. This only affects the auto-generation mode of `SidebarLayout`; composition mode (where children are explicitly provided) is not affected.
8+
9+
```tsx
10+
// This pattern previously rendered a blank page — now correctly redirects:
11+
defineModule({
12+
path: "old-dashboard",
13+
guards: [() => redirectTo("/new-dashboard")],
14+
resources: [...],
15+
});
16+
17+
// Modules/resources with redirectTo guards were previously hidden from
18+
// the sidebar — now they remain visible:
19+
defineModule({
20+
path: "legacy",
21+
guards: [() => redirectTo("/modern")],
22+
resources: [
23+
defineResource({
24+
path: "page",
25+
component: () => <div>Page</div>,
26+
}),
27+
],
28+
});
29+
// "Legacy" and its resources will appear in the sidebar navigation.
30+
```

0 commit comments

Comments
 (0)