---
title: createRoutesFromElements
---
# createRoutesFromElements
[MODES: data]
## Summary
[Reference Documentation ↗](https://api.reactrouter.com/v7/variables/react_router.createRoutesFromElements.html)
Create route objects from JSX elements instead of arrays of objects.
```tsx
const routes = createRoutesFromElements(
<>
>
);
const router = createBrowserRouter(routes);
function App() {
return ;
}
```
## Params
### children
The React children to convert into a route config
### parentPath
The path of the parent route, used to generate unique IDs. This is used for internal recursion and is not intended to be used by the
application developer.
## Returns
An array of [`RouteObject`](https://api.reactrouter.com/v7/types/react_router.RouteObject.html)s that can be used with a [`DataRouter`](https://api.reactrouter.com/v7/interfaces/react_router.DataRouter.html)