Skip to content
This repository has been archived by the owner on Feb 28, 2024. It is now read-only.

krainboltgreene/react-router-component-link.js

Repository files navigation

No longer needed, remix-run/react-router#5437 (comment)

react-router ComponentLink

This is a clone of Link, but it allows you to pass a component property which will be used to render the DOM element being clicked (the traditional Link component renders an <a> element). Nothing else is changed.

Version Tests Stability

using

It works exactly like Link from react-router:

import {Link} from "evergreen-ui"
import ComponentLink from "react-router-component-link"

export default function Header () {
  return <header>
    Welcome to my special website, click <ComponentLink to="/heck" component={Link}>here to go to heck.</ComponentLink>
  </header>
}

That's it.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published