Skip to content

Commit 940a0d0

Browse files
author
Paolo Moretti
committed
[changed] use Object.assign instead of copyProperties
1 parent f8cb7f9 commit 940a0d0

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

modules/components/Routes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
var React = require('react');
22
var warning = require('react/lib/warning');
33
var invariant = require('react/lib/invariant');
4-
var copyProperties = require('react/lib/copyProperties');
4+
var objectAssign = require('react/lib/Object.assign');
55
var HashLocation = require('../locations/HashLocation');
66
var ActiveContext = require('../mixins/ActiveContext');
77
var LocationContext = require('../mixins/LocationContext');
@@ -416,7 +416,7 @@ var Routes = React.createClass({
416416
throw new Error('Passing children to a route handler is not supported');
417417

418418
return route.props.handler(
419-
copyProperties(props, addedProps)
419+
objectAssign(props, addedProps)
420420
);
421421
}.bind(this, props);
422422
});

modules/mixins/ActiveContext.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
var React = require('react');
2-
var copyProperties = require('react/lib/copyProperties');
2+
var objectAssign = require('react/lib/Object.assign');
33

44
/**
55
* A mixin for components that store the active state of routes,
@@ -40,14 +40,14 @@ var ActiveContext = {
4040
* Returns a read-only object of the currently active URL parameters.
4141
*/
4242
getActiveParams: function () {
43-
return copyProperties({}, this.state.activeParams);
43+
return objectAssign({}, this.state.activeParams);
4444
},
4545

4646
/**
4747
* Returns a read-only object of the currently active query parameters.
4848
*/
4949
getActiveQuery: function () {
50-
return copyProperties({}, this.state.activeQuery);
50+
return objectAssign({}, this.state.activeQuery);
5151
},
5252

5353
childContextTypes: {

modules/utils/ServerRendering.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var ReactMarkupChecksum = require('react/lib/ReactMarkupChecksum');
44
var ReactServerRenderingTransaction = require('react/lib/ReactServerRenderingTransaction');
55

66
var cloneWithProps = require('react/lib/cloneWithProps');
7-
var copyProperties = require('react/lib/copyProperties');
7+
var objectAssign = require('react/lib/Object.assign');
88
var instantiateReactComponent = require('react/lib/instantiateReactComponent');
99
var invariant = require('react/lib/invariant');
1010

@@ -16,7 +16,7 @@ function cloneRoutesForServerRendering(routes) {
1616
}
1717

1818
function mergeStateIntoInitialProps(state, props) {
19-
copyProperties(props, {
19+
objectAssign(props, {
2020
initialPath: state.path,
2121
initialMatches: state.matches,
2222
initialActiveRoutes: state.activeRoutes,

0 commit comments

Comments
 (0)