Commit eaadef2
committed
Fix routing
#159 accidentally broke
routing: apparently, React renders *all* matched routes by default,
and so our new snippet id regexp does not play nicely with other
routes like /about or /recent, which are now matched as well, because
both "about" and "recent" are valid snippet ids.
The solution is to use the https://reactrouter.com/web/api/Switch
component which renders the *first* matched Route as opposed to all
of them.1 parent a937493 commit eaadef2
1 file changed
+10
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
55 | 59 | | |
56 | 60 | | |
57 | 61 | | |
| |||
0 commit comments