diff --git a/modules/components/Routes.js b/modules/components/Routes.js index d2e02394c6..97ad122033 100644 --- a/modules/components/Routes.js +++ b/modules/components/Routes.js @@ -1,8 +1,8 @@ var React = require('react'); var warning = require('react/lib/warning'); +var copyProperties = require('react/lib/copyProperties'); var Promise = require('es6-promise').Promise; var goBack = require('../helpers/goBack'); -var mergeProperties = require('../helpers/mergeProperties'); var replaceWith = require('../helpers/replaceWith'); var transitionTo = require('../helpers/transitionTo'); var Route = require('../components/Route'); @@ -216,7 +216,7 @@ function Transition(path) { this.isCancelled = false; } -mergeProperties(Transition.prototype, { +copyProperties(Transition.prototype, { abort: function () { this.cancelReason = new Abort(); @@ -450,7 +450,7 @@ function computeHandlerProps(matches, query) { if (arguments.length > 2 && typeof arguments[2] !== 'undefined') throw new Error('Passing children to a route handler is not supported'); - return route.props.handler(mergeProperties(props, addedProps)); + return route.props.handler(copyProperties(props, addedProps)); }.bind(this, props); }); diff --git a/modules/helpers/Path.js b/modules/helpers/Path.js index 919ef8c15c..19d6f26a8f 100644 --- a/modules/helpers/Path.js +++ b/modules/helpers/Path.js @@ -1,6 +1,6 @@ var invariant = require('react/lib/invariant'); +var copyProperties = require('react/lib/copyProperties'); var qs = require('querystring'); -var mergeProperties = require('./mergeProperties'); var URL = require('./URL'); var paramMatcher = /((?::[a-z_$][a-z0-9_$]*)|\*)/ig; @@ -125,7 +125,7 @@ var Path = { var existingQuery = Path.extractQuery(path); if (existingQuery) - query = query ? mergeProperties(existingQuery, query) : existingQuery; + query = query ? copyProperties(existingQuery, query) : existingQuery; var queryString = query && qs.stringify(query); diff --git a/modules/helpers/mergeProperties.js b/modules/helpers/mergeProperties.js deleted file mode 100644 index 0bca16ce42..0000000000 --- a/modules/helpers/mergeProperties.js +++ /dev/null @@ -1,10 +0,0 @@ -function mergeProperties(object, properties) { - for (var property in properties) { - if (properties.hasOwnProperty(property)) - object[property] = properties[property]; - } - - return object; -} - -module.exports = mergeProperties;