Skip to content

Commit 06b1de2

Browse files
committed
Adds action info to transition
1 parent 44ec859 commit 06b1de2

8 files changed

Lines changed: 16 additions & 9 deletions

File tree

build/lib/Transition.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@ var Redirect = require('./Redirect');
1212
* an instance of this class as their first argument.
1313
*/
1414
function Transition(path, retry) {
15+
var meta = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2];
16+
1517
this.path = path;
1618
this.abortReason = null;
19+
this.meta = meta;
1720
// TODO: Change this to router.retryTransition(transition)
1821
this.retry = retry.bind(this);
1922
}

build/lib/createRouter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ function createRouter(options) {
335335
toRoutes = nextRoutes;
336336
}
337337

338-
var transition = new Transition(path, Router.replaceWith.bind(Router, path));
338+
var transition = new Transition(path, Router.replaceWith.bind(Router, path), { action: action, prevRoutes: prevRoutes, prevPrams: prevPrams, prevQuery: prevQuery });
339339
pendingTransition = transition;
340340

341341
var fromComponents = mountedComponents.slice(prevRoutes.length - fromRoutes.length);

build/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-router",
3-
"version": "0.13.5",
3+
"version": "0.13.6",
44
"description": "A complete routing library for React.js",
55
"main": "lib",
66
"repository": {

build/umd/ReactRouter.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2737,7 +2737,7 @@ return /******/ (function(modules) { // webpackBootstrap
27372737
toRoutes = nextRoutes;
27382738
}
27392739

2740-
var transition = new Transition(path, Router.replaceWith.bind(Router, path));
2740+
var transition = new Transition(path, Router.replaceWith.bind(Router, path), { action: action, prevRoutes: prevRoutes, prevPrams: prevPrams, prevQuery: prevQuery });
27412741
pendingTransition = transition;
27422742

27432743
var fromComponents = mountedComponents.slice(prevRoutes.length - fromRoutes.length);
@@ -3052,8 +3052,11 @@ return /******/ (function(modules) { // webpackBootstrap
30523052
* an instance of this class as their first argument.
30533053
*/
30543054
function Transition(path, retry) {
3055+
var meta = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2];
3056+
30553057
this.path = path;
30563058
this.abortReason = null;
3059+
this.meta = meta;
30573060
// TODO: Change this to router.retryTransition(transition)
30583061
this.retry = retry.bind(this);
30593062
}

build/umd/ReactRouter.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/Transition.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ var Redirect = require('./Redirect');
99
* The willTransitionTo and willTransitionFrom handlers receive
1010
* an instance of this class as their first argument.
1111
*/
12-
function Transition(path, retry) {
12+
function Transition(path, retry, meta = null) {
1313
this.path = path;
1414
this.abortReason = null;
15+
this.meta = meta;
1516
// TODO: Change this to router.retryTransition(transition)
1617
this.retry = retry.bind(this);
1718
}

modules/createRouter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ function createRouter(options) {
370370
toRoutes = nextRoutes;
371371
}
372372

373-
var transition = new Transition(path, Router.replaceWith.bind(Router, path));
373+
var transition = new Transition(path, Router.replaceWith.bind(Router, path), { action, prevRoutes, prevParams, prevQuery });
374374
pendingTransition = transition;
375375

376376
var fromComponents = mountedComponents.slice(prevRoutes.length - fromRoutes.length);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-router",
3-
"version": "0.13.5",
3+
"version": "0.13.6",
44
"description": "A complete routing library for React.js",
55
"main": "build/lib",
66
"repository": {

0 commit comments

Comments
 (0)