Skip to content

Commit

Permalink
fix: remove unused function
Browse files Browse the repository at this point in the history
  • Loading branch information
crherman7 committed Nov 6, 2024
1 parent 9b5932b commit 4decd83
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 23 deletions.
24 changes: 3 additions & 21 deletions packages/app-router/src/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,6 @@ import {
Router,
} from './types';

/**
* Creates the initial layout object for the application.
*
* @returns {LayoutRoot} The initial layout object.
*
* @example
* const initialLayout = createInitialLayout();
* console.log(initialLayout); // { root: {} }
*/
function createInitialLayout(): LayoutRoot {
return {root: {}};
}

/**
* Flattens a nested array of route objects into a flat array while preserving the `stackId`
* of parent routes and associating it with their child routes.
Expand Down Expand Up @@ -79,13 +66,8 @@ function flatten(
// Extract children and the rest of the route properties
const {children, ...routeProps} = route;

const currentStackId = (function () {
if (route.type === 'bottomtab') {
return route.stackId;
}

return parentStackId;
})();
const currentStackId =
route.type === 'bottomtab' ? route.stackId : parentStackId;

// Create the flattened current route without children
const flattenedRoute = {...routeProps, stackId: currentStackId};
Expand Down Expand Up @@ -386,7 +368,7 @@ function registerRoute(
* });
*/
function register({onAppLaunched, routes, Provider = Fragment}: Router) {
const layout = createInitialLayout();
const layout = {root: {}};

const flattenedRoutes = flatten(routes);

Expand Down
3 changes: 1 addition & 2 deletions packages/app-router/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,7 @@ export type RouteMatchRoute = Omit<
* Modal data for managing component modals.
*
* This type encapsulates the data required for managing modal components,
* including methods to resolve or reject the modal, as well as the data
* passed to the modal.
* including methods to resolve or reject the modal.
*/
export type ModalData<T, U> = {
/**
Expand Down

0 comments on commit 4decd83

Please sign in to comment.