We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f9b468e commit 74bf335Copy full SHA for 74bf335
src/Dom/findDOMNode.ts
@@ -10,7 +10,7 @@ export function isDOM(node: any): node is HTMLElement | SVGElement {
10
/**
11
* Retrieves a DOM node via a ref, and does not invoke `findDOMNode`.
12
*/
13
-export function getDOM(node: any): node is HTMLElement | SVGElement {
+export function getDOM(node: any): HTMLElement | SVGElement | null {
14
if (node && typeof node === 'object' && isDOM(node.nativeElement)) {
15
return node.nativeElement;
16
}
@@ -34,7 +34,7 @@ export default function findDOMNode<T = Element | Text>(
34
35
36
if (node instanceof React.Component) {
37
- return ReactDOM.findDOMNode(node) as unknown as T;
+ return ReactDOM.findDOMNode?.(node) as unknown as T;
38
39
40
return null;
0 commit comments