0

I have a question regarding react-router (v4). Is it possible to show specific components by url parameter?

The url / shows the standard page, but if I provide a parameter in the url (i.e. /?target=privacy), then I want to show the Privacy component instead.

Actually my routes look like this:

<Router>
    <Switch>
        <Route exact={true} path="/" component={MainPage} />
        <Route exact={true} path="/privacy" component={Privacy} />
    </Switch>
</Router>

Is there a way to achieve this? Thanks in advance!

dns_nx
  • 3,651
  • 4
  • 37
  • 66

0 Answers0