Merge pull request #1 from shoetten/master

Fix "Uncaught Invariant Violation: getNodeFromInstance [...]" error,
This commit is contained in:
veeramarni 2016-08-16 16:47:30 -04:00 committed by GitHub
commit be09f37fcc

View file

@ -13,16 +13,9 @@ export class Field extends React.Component {
triggerUpdate() {
// Trigger an onChange on inital load, to support browser prefilled values.
const { onChange } = this.props;
let node = ReactDOM.findDOMNode(this);
if (this.input) {
onChange({ target: { value: this.input.value } });
}
// Backward compat.
else if (node) {
let value = node.getElementsByTagName('input')[0].value;
// Match the data format of a typical onChange event.
onChange({ target: { value: value } });
}
}
componentDidMount() {