Skip to content

Commit

Permalink
Address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
trueadm committed Mar 26, 2020
1 parent 00cfbaa commit 2d1b222
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions packages/react-dom/src/events/DOMModernPluginEventSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,16 +318,20 @@ function isMatchingRootContainer(
);
}

export function isManagedDOMElement(target: Object): boolean {
export function isManagedDOMElement(
target: EventTarget | ReactScopeMethods,
): boolean {
return getClosestInstanceFromNode(((target: any): Node)) !== null;
}

export function isValidEventTarget(target: Object): boolean {
return typeof target.addEventListener === 'function';
export function isValidEventTarget(
target: EventTarget | ReactScopeMethods,
): boolean {
return typeof (target: any).addEventListener === 'function';
}

export function isReactScope(target: Object): boolean {
return typeof target.getChildContextValues === 'function';
export function isReactScope(target: EventTarget | ReactScopeMethods): boolean {
return typeof (target: any).getChildContextValues === 'function';
}

export function dispatchEventForPluginEventSystem(
Expand Down

0 comments on commit 2d1b222

Please sign in to comment.