krainboltgreene / react-router-component-link.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

License:ISC License


Languages

Language:JavaScript 100.0%