Skip to content

Commit aed1b45

Browse files
authored
moved createRoutesFromElements for API docs (#12341)
the auto generated api docs put it in a weird spot with a weird URL when it’s defined in the index file instead of with the rest of the functions
1 parent 47953dd commit aed1b45

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

packages/react-router/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export {
106106
Routes,
107107
createMemoryRouter,
108108
createRoutesFromChildren,
109-
createRoutesFromChildren as createRoutesFromElements,
109+
createRoutesFromElements,
110110
renderMatches,
111111
} from "./lib/components";
112112
export {

packages/react-router/lib/components.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,6 +1171,11 @@ export function createRoutesFromChildren(
11711171
return routes;
11721172
}
11731173

1174+
/**
1175+
* Create route objects from JSX elements instead of arrays of objects
1176+
*/
1177+
export let createRoutesFromElements = createRoutesFromChildren;
1178+
11741179
/**
11751180
* Renders the result of `matchRoutes()` into a React element.
11761181
*

0 commit comments

Comments
 (0)