0

The question is pretty self explanatory but I'd very much like to syle my links differently depending on whether the route is active or not.

If Link does not have the ability to style itself based on whether it's the active route, is there a way to get the active route via props or some JavaScript so that I can make my own conditional styling?

Worse comes to worst I can just call a function from my page view that tells the main layout manager what page we're currently on - but I'd prefer not to do this.

jscul
  • 748
  • 1
  • 10
  • 25
  • Not too sure about React Native, I've never used it. But when I use react-router I like to use `NavLink`, as it provides `activeClassName` as a prop. Maybe something to look into? – Blake Aug 05 '18 at 01:19
  • @Blake yeah, I'm actually predominantly a React programmer... React Native is new to me... I definitely have used `NavLink` in React projects but react-router-native doesn't even have `NavLink` components. – jscul Aug 05 '18 at 01:28
  • Just a thought, I'm not versed in React Native. Good luck :) – Blake Aug 05 '18 at 01:32

0 Answers0