Rebass: Using ReactRouter Link and rebass Link together

Created on 30 Nov 2018  路  4Comments  路  Source: rebassjs/rebass

Is there an elegant way to combine React Router Link and Rebass Link? I see I can just style the react-router one directly, but then I might be missing the theme and whatnot from Rebass.

Most helpful comment

You can use the as prop

import { Link as RouterLink } from 'react-router'
import { Link as RebassLink } from 'rebass'

export default props =>
  <RebassLink
    {...props}
    as={RouterLink}
  />

All 4 comments

You can use the as prop

import { Link as RouterLink } from 'react-router'
import { Link as RebassLink } from 'rebass'

export default props =>
  <RebassLink
    {...props}
    as={RouterLink}
  />

Awesome, thanks!

I only see this on dev but using the as keyword here is throwing an unknown prop warning from the a tag:

Warning: React does not recognize the borderRadius prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase borderradius instead. If you accidentally passed it from a parent component, remove it from the DOM element.

+1 Same issue as @steverecio

Was this page helpful?
0 / 5 - 0 ratings

Related issues

steida picture steida  路  4Comments

contra picture contra  路  5Comments

karland picture karland  路  7Comments

chiragjani picture chiragjani  路  6Comments

tpkiddle picture tpkiddle  路  3Comments