From 828ed5ab416fc2ed63c96b2c4e8d07519b4818c9 Mon Sep 17 00:00:00 2001 From: Jonas Date: Wed, 9 May 2018 10:55:05 +0200 Subject: [PATCH] Updated Readme to clarify nested route sequences I also noticed the same problem like issue #274: https://github.com/FormidableLabs/redux-little-router/issues/274 So I decided to add some text to the readme :) --- README.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d552150b..0750732a 100644 --- a/README.md +++ b/README.md @@ -295,7 +295,6 @@ To show a `Fragment` when no other `Fragment`s match a route, use ` ``` - ...React will render: ```html @@ -311,6 +310,28 @@ To show a `Fragment` when no other `Fragment`s match a route, use ` ``` +If you want to use nested fragments for complex navigation patterns, you should remember to put the most generic route at the end of your jsx. If you do not follow this advice your route will just get matched to the first matching route. +Internally the Fragments get converted into default Route objects the sequence is important: +e.G. '/users/:id' -> would get mapped to '/users/' -> render UserManagement. + +To solve this little issue just rearrange the sequences like that: + +```jsx + + + + + + + + + + + + + +``` + `` makes basic component-per-page navigation easy: ```jsx