dillon1000/react

Commit

Only call put/deleteListener with truthy listeners

Without this, transitioning from `<div onClick={null} />` to `<div />` triggered `willDeleteListener` to delete the `click` handler which caused problems; now, we only call `putListener` and `deleteListener` when we have an actual listener.

I now also clean up the `onClickListeners` map upon deletion and don't double-listen when updating the event listener.
Browse files
Changed paths4 files
First-parent comparison
M src/browser/eventPlugins/SimpleEventPlugin.js ModifiedM src/browser/ui/ReactDOMComponent.js ModifiedM src/browser/ui/__tests__/ReactDOMComponent-test.js ModifiedM src/event/EventPluginHub.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…