Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

Doesn't work with react-router IndexLink #829

Open
ratiotile opened this issue Sep 11, 2016 · 2 comments
Open

Doesn't work with react-router IndexLink #829

ratiotile opened this issue Sep 11, 2016 · 2 comments

Comments

@ratiotile
Copy link

ratiotile commented Sep 11, 2016

import {Link, IndexLink} from 'react-router'
export const RadiumLink = Radium(Link)
export const RadiumIndexLink = Radium(IndexLink)

Wrapping IndexLink with Radium doesn't allow it to handle radium styles like :active or arrays of styles.
RadiumIndexLink will not apply style={[a, b]} arrays of styles or browser state styles, but RadiumLink will.

"radium": "^0.18.1"
"react-router": "^2.0.0"
@niksajanjic
Copy link

I second this with issue reported in #817.

That issue also has link to repo where it is possible to see the code (and GIF presentation) which reproduces this bug.

@jordizle
Copy link

jordizle commented Jan 26, 2017

IndexLink is just a wrapper around Link except parsing onlyActiveOnIndex={true} property as you can see here:

https://github.com/ReactTraining/react-router/blob/master/modules/IndexLink.js

So you can do:

<RadiumLink to={'/'} style={style.foo} onlyActiveOnIndex={true}>Home</RadiumLink>

Then the styles will work...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants