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

@weprovide/react-link-renderer

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@weprovide/react-link-renderer

This package will enable you to render a custom link component within a component library for example.

  • 1.0.9
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
36
increased by125%
Maintainers
2
Weekly downloads
 
Created
Source

This package will enable you to render a custom link component within a component library for example.

Install

yarn add @weprovide/react-link-renderer
import {LinkRenderer, LinkRendererProvider, LinkRendererProps} from '@weprovide/react-link-renderer';
import Link from "next/link";

const nextLinkRenderer = ({ href, extraOptions, children }: LinkRendererProps) => {
    return (
        <Link href={href} {...extraOptions}>
            <a>{children}</a>
        </Link>
    );
}

Surround your main app with a LinkRendererProvider

<LinkRendererProvider linkRenderer={nextLinkRenderer}>
    <App />
</LinkRendererProvider>

Now you can use the LinkRenderer component inside your component library to render a link

<LinkRenderer 
    href="/page-1" 
    extraOptions={{
        prefetch: false, // You can add any option you want and use it in your custom link renderer
    }}
>
    Go to page 1
</LinkRenderer>

FAQs

Package last updated on 10 Jan 2023

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