Skip to content

Commit

Permalink
[changed] use Object.assign instead of copyProperties
Browse files Browse the repository at this point in the history
  • Loading branch information
Paolo Moretti committed Oct 31, 2014
1 parent f8cb7f9 commit 940a0d0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions modules/components/Routes.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var React = require('react');
var warning = require('react/lib/warning');
var invariant = require('react/lib/invariant');
var copyProperties = require('react/lib/copyProperties');
var objectAssign = require('react/lib/Object.assign');
var HashLocation = require('../locations/HashLocation');
var ActiveContext = require('../mixins/ActiveContext');
var LocationContext = require('../mixins/LocationContext');
Expand Down Expand Up @@ -416,7 +416,7 @@ var Routes = React.createClass({
throw new Error('Passing children to a route handler is not supported');

return route.props.handler(
copyProperties(props, addedProps)
objectAssign(props, addedProps)
);
}.bind(this, props);
});
Expand Down
6 changes: 3 additions & 3 deletions modules/mixins/ActiveContext.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var React = require('react');
var copyProperties = require('react/lib/copyProperties');
var objectAssign = require('react/lib/Object.assign');

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

/**
* Returns a read-only object of the currently active query parameters.
*/
getActiveQuery: function () {
return copyProperties({}, this.state.activeQuery);
return objectAssign({}, this.state.activeQuery);
},

childContextTypes: {
Expand Down
4 changes: 2 additions & 2 deletions modules/utils/ServerRendering.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var ReactMarkupChecksum = require('react/lib/ReactMarkupChecksum');
var ReactServerRenderingTransaction = require('react/lib/ReactServerRenderingTransaction');

var cloneWithProps = require('react/lib/cloneWithProps');
var copyProperties = require('react/lib/copyProperties');
var objectAssign = require('react/lib/Object.assign');
var instantiateReactComponent = require('react/lib/instantiateReactComponent');
var invariant = require('react/lib/invariant');

Expand All @@ -16,7 +16,7 @@ function cloneRoutesForServerRendering(routes) {
}

function mergeStateIntoInitialProps(state, props) {
copyProperties(props, {
objectAssign(props, {
initialPath: state.path,
initialMatches: state.matches,
initialActiveRoutes: state.activeRoutes,
Expand Down

0 comments on commit 940a0d0

Please sign in to comment.