is there an easy way to make a parent components links override a child components links in react components?

146 Views Asked by At

A quick question, is there a way for a person to set up a link or a nav link in a parent component so that it overrides links in child components automatically in react? I have a parent component that is made up of several child components, and I would like one section of it to ignore the child links and do something else ( reroute to a different, totally new component.)I guess i can do this by passing some kind of flag to the underlying components via props but just wondering if there is a shortcut.

This would make my life a lot easier... ;)

1

There are 1 best solutions below

0
On BEST ANSWER

Nevermind it seems to work v easily by simply adding the component from react-router-dom, thanks for looking