Skip to content

Commit

Permalink
Limit code churn
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobbe committed Jul 28, 2023
1 parent 920da62 commit 32222ec
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 17 deletions.
2 changes: 1 addition & 1 deletion packages/router/src/__tests__/links.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { act, render, waitFor } from '@testing-library/react'
expect.extend({ toHaveClass, toHaveStyle })

import { navigate, Route, Router, routes } from '../'
import { Link, NavLink, useMatch } from '../links'
import { NavLink, useMatch, Link } from '../links'
import { LocationProvider } from '../location'
import { flattenSearchParams, RouteParams } from '../util'

Expand Down
20 changes: 10 additions & 10 deletions packages/router/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@
// Rails' routing approach and from both React Router and Reach Router (the
// latter of which has closely inspired some of this code).

export { navigate, back } from './history'
export { Link, NavLink, useMatch, Redirect } from './links'
export { useLocation, LocationProvider } from './location'
export {
PageLoadingContextProvider,
usePageLoadingContext,
PageLoadingContextProvider,
} from './PageLoadingContext'
export { back, navigate } from './history'
export { Link, NavLink, Redirect, useMatch } from './links'
export { LocationProvider, useLocation } from './location'
export { ParamsContext, ParamsProvider, useParams } from './params'
export { Route, Router, routes } from './router'
export { useParams, ParamsProvider, ParamsContext } from './params'
export { Router, Route, routes } from './router'

export * from './Set'

export * from './route-announcement'
export { default as RouteAnnouncement } from './route-announcement'
export * from './route-focus'
export * from './route-announcement'
export { default as RouteFocus } from './route-focus'
export * from './route-focus'

export { getRouteRegexAndParams, matchPath, parseSearch } from './util'
export { parseSearch, getRouteRegexAndParams, matchPath } from './util'

/**
* A more specific interface will be generated by
Expand All @@ -38,7 +38,7 @@ export interface AvailableRoutes {
) => string
}

export { SkipNavContent, SkipNavLink } from '@reach/skip-nav'
export { SkipNavLink, SkipNavContent } from '@reach/skip-nav'

// Used by packages/internal/src/generate/templates/web-routerRoutes.d.ts.template
export * from './routeParamsTypes'
2 changes: 1 addition & 1 deletion packages/router/src/links.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,4 +190,4 @@ const Redirect = ({ to, options }: RedirectProps) => {
return null
}

export { Link, NavLink, Redirect, useMatch }
export { Link, NavLink, useMatch, Redirect }
8 changes: 4 additions & 4 deletions packages/router/src/router.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { memo, ReactElement, ReactNode, useMemo } from 'react'
import React, { ReactNode, ReactElement, useMemo, memo } from 'react'

import { ActiveRouteLoader } from './active-route-loader'
import { AuthenticatedRoute } from './AuthenticatedRoute'
Expand Down Expand Up @@ -248,9 +248,9 @@ const WrappedPage = memo(
)

export {
isValidRoute as isRoute,
PageType,
Route,
Router,
Route,
namedRoutes as routes,
isValidRoute as isRoute,
PageType,
}
1 change: 0 additions & 1 deletion packages/router/src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,6 @@ export const RouteParams = {
* given args object. Any extra params not used in the path will be appended
* as key=value pairs in the search part.
*
*
* Examples:
*
* replaceParams('/tags/{tag}', { tag: 'code', extra: 'foo' })
Expand Down

0 comments on commit 32222ec

Please sign in to comment.