npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@tschk/moonshine-react-router

v0.4.1

Published

react-router / Remix client API reimplemented on moonshine — drop react-router, keep the imports

Readme

@tschk/moonshine-react-router

The react-router / @remix-run/react client API reimplemented on moonshine. It imports no react-router code and lists none as a dependency: Link, NavLink, useNavigate and friends are ordinary React components written against @tschk/moonshine/router.

An existing app can alias the import and drop the dependency:

// bunfig.toml / tsconfig paths / bundler alias
"react-router" -> "@tschk/moonshine-react-router"
"@remix-run/react" -> "@tschk/moonshine-react-router"
import {
  Link,
  NavLink,
  Outlet,
  useNavigate,
  useSearchParams,
} from "@tschk/moonshine-react-router";
import { json, redirect } from "@tschk/moonshine-react-router/server";

| Subpath | Contents | | -------------- | ------------------------------------------------------- | | . | full client API (components + hooks + response helpers) | | ./link | Link, NavLink, Navigate | | ./navigation | useNavigate, useLocation, useParams, … | | ./outlet | Outlet, OutletProvider, useOutletContext | | ./responses | json, data, redirect, ErrorResponse | | ./server | response helpers + moonshine server handling | | ./client | moonshine signals + resources |

Supported

  • Linkto as string or partial path, replace, preventScrollReset, reloadDocument, prefetch ("intent" hover, "render", "viewport"); modifier-clicks, external URLs and non-_self targets fall through to the browser. Navigation runs inside startTransition.
  • NavLinkend, caseSensitive, className/style/children as render callbacks, aria-current="page", default .active class.
  • Navigate — declarative redirect on mount.
  • Outlet, OutletProvider, useOutlet, useOutletContext.
  • useNavigate (path or numeric delta), useLocation, useParams, useSearchParams (with setter), useHref, useResolvedPath, useNavigationType.
  • json, data, redirect, redirectDocument, replace, ErrorResponse, isRouteErrorResponse.

Not supported

These need react-router's own data router or build plugin and are not provided — do not expect them to work by aliasing:

  • Data APIs: useLoaderData, useActionData, useFetcher, useRevalidator, useSubmit, useNavigation, useBlocker, unstable_usePrompt, defer/Await. There is no loader/action lifecycle in moonshine; fetch in the component or on the moonshine server route.
  • Route configuration: createBrowserRouter, RouterProvider, Routes, Route, createRoutesFromElements, nested route matching. Moonshine matches a flat route table via MoonshineRouter; <Outlet> is fed explicitly by <OutletProvider> rather than derived from nested config.
  • Progressive enhancement: <Form>, <Scripts>, <Meta>, <Links>, <ScrollRestoration>, <Await>, useFormAction.
  • History state: location.state, location.key stability and useNavigationType distinguishing PUSH/POP/REPLACE. state is always null and useNavigationType() always returns "POP".
  • Error boundaries: useRouteError, errorElement. ErrorResponse and isRouteErrorResponse exist as value types only.
  • useSearchParams reads window.location.search; on the server it is empty because moonshine's router signal carries the pathname only.

See Moonshine README.