Skip to content

Commit 1e3cfdf

Browse files
Pavlo AksonovPavlo Aksonov
authored andcommitted
pass Router props to actions
1 parent 7014168 commit 1e3cfdf

File tree

3 files changed

+37
-35
lines changed

3 files changed

+37
-35
lines changed

Example/.idea/workspace.xml

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

index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,12 @@ class Router extends React.Component {
7777
} else if (child.type.prototype.className() == "Action") {
7878
//console.log("Added action: " + name);
7979
if (!(RouterActions[name])) {
80+
81+
// merge Router props with children props
82+
var props = Object.assign({}, self.props);
83+
props = Object.assign(props, child.props)
8084
RouterActions[name] = alt.createAction(name, function(data){
81-
RouterActions.custom({name, props: child.props, data:data})});
85+
RouterActions.custom({name, props, data})});
8286
}
8387
}
8488
});

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-router-flux",
3-
"version": "0.1.9",
3+
"version": "0.1.10",
44
"description": "React Native Router using Flux architecture",
55
"main": "index.js",
66
"scripts": {
@@ -24,9 +24,9 @@
2424
"alt": "^0.17.1"
2525
},
2626
"gitHead": "ac054cfda0894ba1db6c4901ebdddc83b3b2d083",
27-
"_id": "[email protected].8",
28-
"_shasum": "0e4671550c307ce7ea940eb4ff624e217bcc5225",
29-
"_from": "[email protected].8",
27+
"_id": "[email protected].9",
28+
"_shasum": "c2f38efddfcce1fe65187777de24e8418af1f276",
29+
"_from": "[email protected].9",
3030
"_npmVersion": "2.13.2",
3131
"_nodeVersion": "2.5.0",
3232
"_npmUser": {

0 commit comments

Comments
 (0)