Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

peppermint-router

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

peppermint-router

Lightweight hash router for React

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
0
Weekly downloads
 
Created
Source

peppermint-router

Lightweight hash router for React

package size npm version license

The gist

<RouterView>
    <Route path="/" component={HomePage} />
    <Route path="home" component={HomePage} />
    <Route path="about" component={AboutPage} />
    <RouteFallback component={NotFound} />
</RouterView>

Prompt navigation

<PromptNavigation
    enabled={true}
    exitPrompt="Leave the application?"
>
    {({ isNavigating, confirm, cancel }) => (
        isNavigating && (
            <div>
                <span>Move to another page?</span>
                <button onClick={confirm}>Confirm</button>
                <button onClick={cancel}>Cancel</button>
            </div>
        )
    )}
</PromptNavigation>

Why?

  • Extremely compact - less than 2kb gzipped!
  • Does not require special <Link> tags and other boilerplate.
  • <PromptNavigation> component with custom prompt out of the box.

Why not?

  • Only hash routes
  • No SSR support
  • No React Native support

Changelog

The change log can be found here.

FAQs

Package last updated on 07 Aug 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc