onlyActiveOnIndex 属性为 true 的 组件,例如有这样一个链接:

  1. <Link to="/user" />

如果当前 URL 是 /user/123,该链接也会被激活。如果我们只希望它在 /user 激活,可以直接使用 <IndexLink>

  1. <IndexLink to="/user" />