Skip to content

Commit 109cead

Browse files
Update error message
1 parent 9132cfe commit 109cead

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/react-router/__tests__/createRoutesFromChildren-test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,6 @@ describe("creating routes from JSX", () => {
216216
</Route>
217217
</Route>
218218
);
219-
}).toThrow("An index route cannot have children routes.");
219+
}).toThrow("An index route must not have child routes.");
220220
});
221221
});

packages/react-router/lib/components.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ export function createRoutesFromChildren(
585585
};
586586

587587
if (element.props.children) {
588-
invariant(!route.index, "An index route cannot have children routes.");
588+
invariant(!route.index, "An index route must not have child routes.");
589589
route.children = createRoutesFromChildren(
590590
element.props.children,
591591
treePath

0 commit comments

Comments
 (0)