Data sorting can be accessed through context.location, but this will throw a warning that this has been deprecated.
< p>
Only an object named
router
is added to context. Accessingthis.context.history
,this.context. location
, andthis.context.route
are all deprecated. This new object contains the methods available fromhistory
(such aspush
,replace
) along withsetRouteLeaveHook
.
Unfortunately, this does not include location data, so you need to pass it yourself to Child (non-route handler) component.
In React-router 1.0/2.0, the route parameters this.props.params can be accessed from the Route component-but there seems to be no support The method accesses the parameters from the components deeply contained in the Route component above.
Data sorting can be accessed through context.location, but this will throw a warning that this has been deprecated.< /p>
From in the latest Starting with version of React Router, all context data has been deprecated to support this.context.router:
Only an object named
router
is added to context. Accessingthis.context.history
,this.context.location
, andthis.context.route
are all deprecated. This new object contains the methods available fromhistory
(such aspush
,replace
) along withsetRouteLeaveHook
.
Unfortunately, this does not include location data, so you need to pass it yourself to the child (non-route handler) component.