Skip to content

Commit

Permalink
moved createRoutesFromElements for API docs (#12341)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ryanflorence authored Nov 23, 2024
1 parent 47953dd commit aed1b45
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/react-router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export {
Routes,
createMemoryRouter,
createRoutesFromChildren,
createRoutesFromChildren as createRoutesFromElements,
createRoutesFromElements,
renderMatches,
} from "./lib/components";
export {
Expand Down
5 changes: 5 additions & 0 deletions packages/react-router/lib/components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1171,6 +1171,11 @@ export function createRoutesFromChildren(
return routes;
}

/**
* Create route objects from JSX elements instead of arrays of objects
*/
export let createRoutesFromElements = createRoutesFromChildren;

/**
* Renders the result of `matchRoutes()` into a React element.
*
Expand Down

0 comments on commit aed1b45

Please sign in to comment.