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

gatsby-plugin-exact-client-paths

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gatsby-plugin-exact-client-paths

Gatsby plugin for client rendering exact page routes.

  • 0.4.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11
increased by83.33%
Maintainers
1
Weekly downloads
 
Created
Source

gatsby-plugin-exact-client-paths

License: MIT

Gatsby plugin for client rendering exact page routes.

Install

yarn add gatsby-plugin-exact-client-paths

Usage

// gatsby-config.js

module.exports = {
  plugins: [
    {
      resolve: 'gatsby-plugin-exact-client-paths',
      options: {
        clientPaths: ['/preview', '/clientOnly'],
      },
    },
  ],
}

How is this different from gatsby-plugin-create-client-paths?

This plugin attempts to address the inability to client-side render singular routes in Gatsby, most particularly with top level routes such as /preview.

With gatsby-plugin-create-client-paths, you must create at least 1 route that is still processed via Gatsby's SSR pipeline that handles the client-side routing for nested paths. This can be problematic when top level client-side routes like https://hostname.com/preview are needed, and we don't want to imperatively define a <Router> component directly in our homepage index component.

This plugin establishes a <Router> behind the scenes of your index page that will normally display your SSR'd content or a client rendered page if the current path matches a path specified in the clientPaths plugin options.

Current Limitations

  • Client rendered paths & component trees that call Gatsby's useStaticQuery hook will crash.

Run tests

yarn test

📝 License

This project is MIT licensed.

Keywords

FAQs

Package last updated on 13 Sep 2019

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