dillon1000/react

Commit

Fix `ReactDOMInput` and `ReactDOMTextarea` Race Condition

This fixes a race condition if the `onClick` tries to update the input or textarea (e.g. by calling `setState`):

  <input
    onClick={function(event) {
      this.setState({somethingElse: true}); // Triggers an update.
      // event.target.value is now equal to the old value, fail...
      this.props.onChange(event);
    })
  />
Browse files
Changed paths2 files
First-parent comparison
M src/dom/components/ReactDOMInput.js ModifiedM src/dom/components/ReactDOMTextarea.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…