Skip to content

Router sets active class for root route always #1614

@drewhamlett

Description

@drewhamlett
<Link to="/">Dashboard</Link>
<Link to="surveys">Surveys</Link>

ReactDOM.render((
  <Router history={history}>
    <Route component={App}>
      <Route name="dashboard" path="/" component={Dashboard} />
      <Route name="surveys" path="/surveys" component={Surveys} />
    </Route>
  </Router>
), document.getElementById('main'));

If I'm the dashboard route then just dashboard link gets active class. If I'm on surveys, dashboard and surveys link gets active class.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions