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 🙏

© 2024 – Pkg Stats / Ryan Hefner

andpramor-react-router

v0.0.3

Published

In this project, I built a **custom React router** from the ground up! It's a routing system that powers Single Page Applications (SPAs) with smooth navigation.

Downloads

2

Readme

🚀 React Router From Scratch

In this project, I built a custom React router from the ground up! It's a routing system that powers Single Page Applications (SPAs) with smooth navigation.

🌟 Features

  • Single Page Application (SPA) Navigation: Achieve seamless page transitions without reloading the page, giving your app a dynamic feel.
  • Back/Forward Navigation: Enable navigation through browser history (back/forward buttons), without reloading the page, offering a user-friendly experience.
  • Declarative <Link /> Component: The <Link> component allows for seamless navigation within the app, similar to React Router. It accepts to (the destination path), target (e.g., _blank for opening in a new tab), and additional ...props. While it typically navigates within the app as an SPA, it gracefully handles cases like target="_blank" by ignoring SPA behavior. The text passed as children (e.g., <Link>My text</Link>) is properly displayed as a regular anchor's content would.
  • Declarative <Router /> Component: Define routes declaratively, making routing intuitive and easy to manage within your app. Accepts both an array of routes, with every route being an object with a path and the Component to be displayed, and <Route /> components passed to Router as children.
  • 404 Handling (Default Route): Automatically direct users to a 404 page or a default route when a page is not found.
  • Route Parameters: Pass dynamic data through the URL, allowing for flexible routing patterns (e.g.: /user/:id).
  • Declarative <Route /> Component: Define specific routes for each page in your app, controlling which components should render based on the URL.
  • Lazy Loading for Routes: Boost performance by loading route components lazily, only when they’re needed.

📋 Testing

I ensured the router behaves as expected testing its methods with vitest and @testing-library/react.

🔗 Demo

You can check out a minimal demo project built using this router here.

  • The demo project also includes Internationalization (i18n): Supports multiple languages and localization, allowing pages to adapt based on the user's language as determined by the active route. This feature demonstrates the use of route parameters but is not directly related to the router itself and is not included in the NPM package.

📦 Installation

npm install andpramor-react-router