Fix blank /students/new and /students/$id (missing Outlet)
students.tsx was the list AND the parent of students.new / students.$id but rendered no <Outlet/>, so child routes never showed. Make students.tsx an Outlet layout and move the list to students.index.tsx. Add an errorComponent to students.new as a safety net. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -15,6 +15,12 @@ import { toast } from "sonner";
|
||||
export const Route = createFileRoute("/_authenticated/students/new")({
|
||||
head: () => ({ meta: [{ title: "New student — School Portal" }] }),
|
||||
component: NewStudentPage,
|
||||
errorComponent: ({ error }) => (
|
||||
<div className="p-8 max-w-2xl">
|
||||
<h1 className="text-lg font-semibold text-destructive">This page hit an error</h1>
|
||||
<pre className="mt-3 whitespace-pre-wrap break-words text-xs bg-muted p-3 rounded border">{error?.message}{"\n\n"}{error?.stack}</pre>
|
||||
</div>
|
||||
),
|
||||
});
|
||||
|
||||
type Guardian = {
|
||||
|
||||
Reference in New Issue
Block a user