We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 63f1be5 commit 1310febCopy full SHA for 1310feb
modules/Redirect.js
@@ -23,10 +23,14 @@ var Redirect = React.createClass({
23
if (route.from)
24
route.path = route.from;
25
26
+ // TODO: Handle relative pathnames, see #1658
27
+ invariant(
28
+ route.to.charAt(0) === '/',
29
+ '<Redirect to> must be an absolute path. This should be fixed in the future'
30
+ );
31
+
32
route.onEnter = function (nextState, redirectTo) {
33
var { location, params } = nextState;
-
- // TODO: Handle relative pathnames.
34
var pathname = route.to ? formatPattern(route.to, params) : location.pathname;
35
36
redirectTo(
0 commit comments