Skip to content
This repository was archived by the owner on May 23, 2018. It is now read-only.

Commit efe3fbc

Browse files
committed
feat: add activeStrict prop on Link and fix typo
1 parent 2c641fd commit efe3fbc

File tree

10 files changed

+20
-12
lines changed

10 files changed

+20
-12
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "router5-react",
3-
"version": "0.1.0-alpha.5",
3+
"version": "0.1.0-alpha.6",
44
"homepage": "http://router5.github.io",
55
"authors": [
66
"Thomas Roch <thomas.c.roch@gmail.com>"

dist/amd/link-factory.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@ define(['exports', 'module', 'react'], function (exports, module, _react) {
1414
routeParams: _React['default'].PropTypes.object,
1515
routeOptions: _React['default'].PropTypes.object,
1616
activeClassName: _React['default'].PropTypes.string,
17+
activeStrict: _React['default'].PropTypes.bool,
1718
onClick: _React['default'].PropTypes.func
1819
},
1920

2021
getDefaultProps: function getDefaultProps() {
2122
return {
2223
className: '',
2324
activeClassName: 'active',
25+
activeStrict: false,
2426
routeParams: {},
2527
routeOptions: {}
2628
};
@@ -31,7 +33,7 @@ define(['exports', 'module', 'react'], function (exports, module, _react) {
3133
// Not an anti-pattern
3234
// https://facebook.github.io/react/tips/props-in-getInitialState-as-anti-pattern.html
3335
return {
34-
active: router.isActive(this.props.routeName, this.props.routeParams)
36+
active: router.isActive(this.props.routeName, this.props.routeParams, this.props.activeStrict)
3537
};
3638
},
3739

dist/amd/segment-mixin-factory.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ define(["exports", "module"], function (exports, module) {
1616
},
1717

1818
componentWillUnmount: function componentWillUnmount() {
19-
router.addremoveNodeListener(routeName, this.nodeListener);
19+
router.removeNodeListener(routeName, this.nodeListener);
2020
router.deregisterComponent(routeName, this);
2121
}
2222
};

dist/browser/router5-react.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,15 @@ function linkFactory(router) {
3232
routeParams: React.PropTypes.object,
3333
routeOptions: React.PropTypes.object,
3434
activeClassName: React.PropTypes.string,
35+
activeStrict: React.PropTypes.bool,
3536
onClick: React.PropTypes.func
3637
},
3738

3839
getDefaultProps: function getDefaultProps() {
3940
return {
4041
className: '',
4142
activeClassName: 'active',
43+
activeStrict: false,
4244
routeParams: {},
4345
routeOptions: {}
4446
};
@@ -49,7 +51,7 @@ function linkFactory(router) {
4951
// Not an anti-pattern
5052
// https://facebook.github.io/react/tips/props-in-getInitialState-as-anti-pattern.html
5153
return {
52-
active: router.isActive(this.props.routeName, this.props.routeParams)
54+
active: router.isActive(this.props.routeName, this.props.routeParams, this.props.activeStrict)
5355
};
5456
},
5557

@@ -103,7 +105,7 @@ function segmentMixinFactory(router) {
103105
},
104106

105107
componentWillUnmount: function componentWillUnmount() {
106-
router.addremoveNodeListener(routeName, this.nodeListener);
108+
router.removeNodeListener(routeName, this.nodeListener);
107109
router.deregisterComponent(routeName, this);
108110
}
109111
};

dist/browser/router5-react.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/commonjs/link-factory.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@ function linkFactory(router) {
1919
routeParams: _react2['default'].PropTypes.object,
2020
routeOptions: _react2['default'].PropTypes.object,
2121
activeClassName: _react2['default'].PropTypes.string,
22+
activeStrict: _react2['default'].PropTypes.bool,
2223
onClick: _react2['default'].PropTypes.func
2324
},
2425

2526
getDefaultProps: function getDefaultProps() {
2627
return {
2728
className: '',
2829
activeClassName: 'active',
30+
activeStrict: false,
2931
routeParams: {},
3032
routeOptions: {}
3133
};
@@ -36,7 +38,7 @@ function linkFactory(router) {
3638
// Not an anti-pattern
3739
// https://facebook.github.io/react/tips/props-in-getInitialState-as-anti-pattern.html
3840
return {
39-
active: router.isActive(this.props.routeName, this.props.routeParams)
41+
active: router.isActive(this.props.routeName, this.props.routeParams, this.props.activeStrict)
4042
};
4143
},
4244

dist/commonjs/segment-mixin-factory.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function segmentMixinFactory(router) {
1818
},
1919

2020
componentWillUnmount: function componentWillUnmount() {
21-
router.addremoveNodeListener(routeName, this.nodeListener);
21+
router.removeNodeListener(routeName, this.nodeListener);
2222
router.deregisterComponent(routeName, this);
2323
}
2424
};

modules/link-factory.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ function linkFactory(router) {
99
routeParams: React.PropTypes.object,
1010
routeOptions: React.PropTypes.object,
1111
activeClassName: React.PropTypes.string,
12+
activeStrict: React.PropTypes.bool,
1213
onClick: React.PropTypes.func
1314
},
1415

1516
getDefaultProps() {
1617
return {
1718
className: '',
1819
activeClassName: 'active',
20+
activeStrict: false,
1921
routeParams: {},
2022
routeOptions: {}
2123
};
@@ -26,7 +28,7 @@ function linkFactory(router) {
2628
// Not an anti-pattern
2729
// https://facebook.github.io/react/tips/props-in-getInitialState-as-anti-pattern.html
2830
return {
29-
active: router.isActive(this.props.routeName, this.props.routeParams)
31+
active: router.isActive(this.props.routeName, this.props.routeParams, this.props.activeStrict)
3032
};
3133
},
3234

modules/segment-mixin-factory.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function segmentMixinFactory(router) {
1212
},
1313

1414
componentWillUnmount() {
15-
router.addremoveNodeListener(routeName, this.nodeListener)
15+
router.removeNodeListener(routeName, this.nodeListener)
1616
router.deregisterComponent(routeName, this)
1717
}
1818
})

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "router5-react",
3-
"version": "0.1.0-alpha.5",
3+
"version": "0.1.0-alpha.6",
44
"description": "router5 helpers for React",
55
"main": "dist/commonjs/index.js",
66
"scripts": {
@@ -33,6 +33,6 @@
3333
"uglify-js2": "^2.1.11"
3434
},
3535
"peerDependencies": {
36-
"router5": ">=0.1.0-rc.5"
36+
"router5": ">=0.1.0-rc.6"
3737
}
3838
}

0 commit comments

Comments
 (0)