resolveData is called when a location change occurs. Use this to prime your
networking cache with data needed for this route's components.
The resolution marks completion of a React concurrent transition.
The first argument passed will be whatevever you passed to the <RouteProvider/>'s resolveWith.
This helps with dispatchers whose lifetime is restricted to React.
... more
Additional members can be defined and will be passed as props to the component.
lazy(() => Promise<{ default: Component }>)
Like React.lazy() but built for fetch-as-you-render as well as being memo'd.
Component will be rendered with props from the route match as well as any matching elements (like 'id' for /users/:id)
<RouteProvider/>
Tracks and binds history to React. Place this in your top level provider.
<MatchedRoute/>
Renders the currently matched route with the route passed as props. Place this in the body of your application below
the <RouteProvider/>
useShowLoading(timeoutMs=100): boolean
This returns true when React is transitioning in Suspense. Use this to render a loading indicator in your application.
We found that @anansi/router demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.It has 1 open source maintainer collaborating on the project.
Package last updated on 29 Mar 2025
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Socket’s Threat Research Team has uncovered 60 npm packages using post-install scripts to silently exfiltrate hostnames, IP addresses, DNS servers, and user directories to a Discord-controlled endpoint.