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:
Ben Alpert
2015-09-30 16:53:47 -07:00
parent 249e0f7331
commit 2b63601472
2 changed files with 7 additions and 1 deletions
@@ -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);