mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Don't throw for onClick={false} in initial render
I accidentally regressed this in #3246. Now this matches what we already checked for updates.
This commit is contained in:
@@ -656,7 +656,9 @@ ReactDOMComponent.Mixin = {
|
||||
continue;
|
||||
}
|
||||
if (registrationNameModules.hasOwnProperty(propKey)) {
|
||||
enqueuePutListener(this._rootNodeID, propKey, propValue, transaction);
|
||||
if (propValue) {
|
||||
enqueuePutListener(this._rootNodeID, propKey, propValue, transaction);
|
||||
}
|
||||
} else {
|
||||
if (propKey === STYLE) {
|
||||
if (propValue) {
|
||||
|
||||
@@ -630,6 +630,10 @@ describe('ReactDOMComponent', function() {
|
||||
SimpleEventPlugin.willDeleteListener = mocks.getMockFunction();
|
||||
var container = document.createElement('div');
|
||||
|
||||
ReactDOM.render(<div onClick={false} />, container);
|
||||
expect(SimpleEventPlugin.didPutListener.mock.calls.length).toBe(0);
|
||||
expect(SimpleEventPlugin.willDeleteListener.mock.calls.length).toBe(0);
|
||||
|
||||
ReactDOM.render(<div onClick={null} />, container);
|
||||
expect(SimpleEventPlugin.didPutListener.mock.calls.length).toBe(0);
|
||||
expect(SimpleEventPlugin.willDeleteListener.mock.calls.length).toBe(0);
|
||||
|
||||
Reference in New Issue
Block a user