dillon1000/react

Commit

Remove pendingUpdate optimization in ReactDOMSelect (#8175)

This removes an optimization that avoids call update on ReactDOMSelect
twice in an onChange event.

https://github.com/facebook/react/commit/2601b6a0b0c2b0bccaca67fbbfab6987ac5bef30#commitcomment-19643403

None of the other controlled components do this. The only reason to do it
here is because of the loop.

I'd like to remove this because I'd like to remove all the side-effects
that happen in onChange, other than user defined behavior. I'd also like to
get rid of state that track sequences. It is easier if everything is just
diffing.

Alternatively I can store the previous value that we processed and only
reprocess if the value has changed. However, that would requires the array
for multiple values to be immutable and I don't think we enforce that
right now.

In Fiber, I believe that we'll be able to batch both these updates into a
single commit.
Browse files
Changed paths2 files
First-parent comparison
M src/renderers/dom/shared/wrappers/__tests__/ReactDOMSelect-test.js ModifiedM src/renderers/dom/stack/client/wrappers/ReactDOMSelect.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…