@samitouri / QOS-React / commits / 5a1e30a868

Ignore events on text nodes (#9000)

In React Native events can fire on text nodes (on Android at least). In that case, the current element will be a string and not props. These can not have event handlers on them so we need to bail out so that we don't throw later on.

Sebastian Markbåge committed Feb 14, 2017 at 11:08 UTC 5a1e30a868b96753504a4a29a60a820f9c81ed76
1 file changed +4
src/renderers/shared/shared/event/EventPluginHub.js
+4
@@ -138,6 +138,10 @@ var EventPluginHub = {
138 return null;
139 }
140 } else {
141 + if (typeof inst._currentElement === 'string') {
142 + // Text node, let it bubble through.
143 + return null;
144 + }
145 const props = inst._currentElement.props;
146 listener = props[registrationName];
147 if (shouldPreventMouseEvent(registrationName, inst._currentElement.type, props)) {