Commit 6db426a5 authored by Matthew Taylor's avatar Matthew Taylor

Use empty default object

Looks as if the having one of these objects as the default causes overwriting in some way, as opposed to augmentation. Have the source object be an empty one, so that it gets the attributes of both defaults and props. Fixes #642.
parent 5b288e4d
......@@ -29,8 +29,9 @@ module.exports.validationHOCFactory = function (defaultValidationErrors) {
var ValidatedComponent = React.createClass({
render: function () {
var validationErrors = defaults(
this.props.validationErrors,
defaultValidationErrors
{},
defaultValidationErrors,
this.props.validationErrors
);
return (
<Component {...this.props} validationErrors={validationErrors} />
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment