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.
This commit is contained in:
parent
7bdc189147
commit
5a1e30a868
|
@ -138,6 +138,10 @@ var EventPluginHub = {
|
|||
return null;
|
||||
}
|
||||
} else {
|
||||
if (typeof inst._currentElement === 'string') {
|
||||
// Text node, let it bubble through.
|
||||
return null;
|
||||
}
|
||||
const props = inst._currentElement.props;
|
||||
listener = props[registrationName];
|
||||
if (shouldPreventMouseEvent(registrationName, inst._currentElement.type, props)) {
|
||||
|
|
Loading…
Reference in New Issue