react-input-message
Advanced tools
Comparing version 0.12.1 to 0.12.2
@@ -67,6 +67,6 @@ 'use strict'; | ||
if (container) { | ||
this.unsubscribe = container.subscribe(function (messages) { | ||
messages = mapMessages(messages, resolveNames, _this2.props, container); | ||
this.unsubscribe = container.subscribe(function (allMessages) { | ||
var messages = mapMessages(allMessages, resolveNames, _this2.props, _this2.context.messageContainer); | ||
_this2.setState({ messages: messages }); | ||
_this2.setState({ messages: messages, allMessages: allMessages }); | ||
}); | ||
@@ -77,7 +77,16 @@ } | ||
MessageListener.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps, nextContext) { | ||
var _this3 = this; | ||
if (mapMessages && mapMessages.length >= 2) { | ||
var container = nextContext.messageContainer; | ||
this.setState({ | ||
messages: mapMessages(this.state.messages, resolveNames, nextProps, container) | ||
}); | ||
(function () { | ||
var container = nextContext.messageContainer; | ||
// callback style because the listener may have been called before | ||
// and not had a chance to flush it's changes yet | ||
_this3.setState(function (_ref) { | ||
var allMessages = _ref.allMessages; | ||
return { | ||
messages: mapMessages(allMessages, resolveNames, nextProps, container) | ||
}; | ||
}); | ||
})(); | ||
} | ||
@@ -91,3 +100,6 @@ }; | ||
MessageListener.prototype.render = function render() { | ||
return _react2.default.createElement(Component, _extends({}, this.props, this.state)); | ||
var messages = this.state.messages; | ||
return _react2.default.createElement(Component, _extends({}, this.props, { messages: messages })); | ||
}; | ||
@@ -94,0 +106,0 @@ |
{ | ||
"name": "react-input-message", | ||
"description": "unopinionated form input annotation", | ||
"version": "0.12.1", | ||
"version": "0.12.2", | ||
"repository": { | ||
@@ -6,0 +6,0 @@ "url": "git://github.com/jquense/react-input-message.git" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24625
517