Skip to content

Commit 76dd3dd

Browse files
committed
Add RouteComponent definition
1 parent 51a3731 commit 76dd3dd

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

docs/Glossary.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ A *redirect function* is used in [`onEnter` hooks](#enterhook) to trigger a tran
108108
### Route
109109

110110
type Route = {
111-
component: Component;
111+
component: RouteComponent;
112112
path: ?RoutePattern;
113113
onEnter: ?EnterHook;
114114
onLeave: ?LeaveHook;
@@ -118,6 +118,18 @@ A *route* specifies a [component](#component) that is part of the user interface
118118

119119
It may help to think of a route as an "entry point" into your UI. You don't need a route for every component in your component hierarchy, only for those places where your UI differs based on the URL.
120120

121+
### RouteComponent
122+
123+
type RouteComponent = Component;
124+
125+
The term *route component* refers to a [component](#component) that is directly rendered by a [route](#route) (i.e. the `<Route component>`). The router creates elements from route components and provides them as `this.props.children` to route components further up the hierarchy. In addition to `children`, route components receive the following props:
126+
127+
- `router` – The [router](#router) instance
128+
- `location` – The current [location](#location)
129+
- `params` – The current [params](#params)
130+
- `route` – The [route](#route) that declared this component
131+
- `routeParams` – A subset of the [params](#params) that were specified in the route's [`path`](#routepattern)
132+
121133
### RouteConfig
122134

123135
type RouteConfig = Array<Route>;
@@ -152,7 +164,7 @@ A *router* is a [`history`](http://rackt.github.io/history) object (akin to `win
152164
There are two primary interfaces for computing a router's next [state](#routerstate):
153165

154166
- `history.listen` is to be used in stateful environments (such as web browsers) that need to update the UI over a period of time. This method immediately invokes its `listener` argument once and returns a function that must be called to stop listening for changes
155-
- `history.match` is a pure function that does not update the history's internal state. This makes it ideal for server-side environments where many requests must be handled concurrently
167+
- `history.match` is a pure asynchronous function that does not update the history's internal state. This makes it ideal for server-side environments where many requests must be handled concurrently
156168

157169
### RouterListener
158170

0 commit comments

Comments
 (0)