Skip to content

Commit

Permalink
Warn on nested EventTragets in experimental event API (#15287)
Browse files Browse the repository at this point in the history
  • Loading branch information
trueadm authored Apr 1, 2019
1 parent 24391e8 commit 8e36284
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ReactTestHostConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ export function getChildHostContextForEvent(
): HostContext {
if (__DEV__ && enableEventAPI) {
if (type === REACT_EVENT_COMPONENT_TYPE) {
warning(
parentHostContext !== EVENT_TARGET_CONTEXT,
'validateDOMNesting: React event targets must not have event components as children.',
);
return EVENT_COMPONENT_CONTEXT;
} else if (type === REACT_EVENT_TARGET_TYPE) {
warning(
Expand Down

0 comments on commit 8e36284

Please sign in to comment.