Skip to content

Commit

Permalink
fix(types): fix type of 'safeFindDOMNode' function (#6465)
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanCavanaugh committed Oct 12, 2022
1 parent f735411 commit f2f1847
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/OverlayTrigger.tsx
Expand Up @@ -201,7 +201,7 @@ function OverlayTrigger({
? React.Children.only(children).props
: ({} as any);

const attachRef = (r: React.ComponentClass | Element | null | undefined) => {
const attachRef = (r: React.Component | Element | null | undefined) => {
mergedRef(safeFindDOMNode(r));
};

Expand Down
4 changes: 1 addition & 3 deletions src/TransitionWrapper.tsx
Expand Up @@ -39,9 +39,7 @@ const TransitionWrapper = React.forwardRef<
const nodeRef = useRef<HTMLElement>(null);
const mergedRef = useMergedRefs(nodeRef, childRef);

const attachRef = (
r: React.ComponentClass | Element | null | undefined,
) => {
const attachRef = (r: React.Component | Element | null | undefined) => {
mergedRef(safeFindDOMNode(r));
};

Expand Down
2 changes: 1 addition & 1 deletion src/safeFindDOMNode.ts
@@ -1,7 +1,7 @@
import ReactDOM from 'react-dom';

export default function safeFindDOMNode(
componentOrElement: React.ComponentClass | Element | null | undefined,
componentOrElement: React.Component | Element | null | undefined,
) {
if (componentOrElement && 'setState' in componentOrElement) {
return ReactDOM.findDOMNode(componentOrElement);
Expand Down

0 comments on commit f2f1847

Please sign in to comment.