React-Router - Route Matching

  • 内嵌是否match
  • path是否match
  • 多个match的时候优先第一个

内嵌不说了

Path

<Route path="/hello/:name">         // matches /hello/michael and /hello/ryan
<Route path="/hello(/:name)"> // matches /hello, /hello/michael, and /hello/ryan
<Route path="/files/*.*"> // matches /files/hello.jpg and /files/hello.html
<Route path="/**/*.jpg"> // matches /files/hello.jpg and /files/path/to/file.jpg

Precedence

其实就被同级覆盖了,redirect是被覆盖住了.match顺序是top to bottom