From db9ef0b1801352005cb5ea8cd5065961af871d68 Mon Sep 17 00:00:00 2001 From: Monica Olinescu Date: Tue, 1 Aug 2017 10:37:39 -0700 Subject: [PATCH] Update docs on Fragment --- README.md | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d07992eb..ce61a41e 100644 --- a/README.md +++ b/README.md @@ -263,7 +263,7 @@ You can use `withConditions` in conjunction with `forRoute` to set strict condit To show a `Fragment` when other `Fragment`s match a route, use ``. -`` lets you nest fragments to match your UI hierarchy to your route hierarchy, much like the `` component does in `react-router@v3`. Given a URL of `/about/bio/dat-boi`, and the following elements: +`` lets you nest fragments to match your UI hierarchy to your route hierarchy, much like the `` component does in `react-router@v3`. Given the following elements: ```jsx @@ -284,7 +284,7 @@ To show a `Fragment` when other `Fragment`s match a route, use ` ``` -...React will render: +...with the URL `/about/bio/dat-boi`, React will render: ```html
@@ -312,6 +312,24 @@ To show a `Fragment` when other `Fragment`s match a route, use ` ``` +The order in which ``s are declared matters, as redux-little-router will render the the first matching Fragment and ignore the rest. + +```jsx + +
+ +
Home
+
+ +
Foo
+
+ +
Foo Bar -- will not show for a url of /foo/bar, because the /foo Fragment matched
+
+
+
+``` + ### `` Using the `` component is simple: