chore(react): udpate return type of fixedForwardRef function

This commit is contained in:
moklick
2024-05-07 14:47:47 +02:00
parent b9ec783b6b
commit 5093213116
+3 -3
View File
@@ -1,4 +1,4 @@
import { ReactNode, Ref, RefAttributes, forwardRef } from 'react';
import { type Ref, type RefAttributes, forwardRef } from 'react';
import { isNodeBase, isEdgeBase } from '@xyflow/system';
import type { Edge, Node } from '../types';
@@ -25,8 +25,8 @@ export const isEdge = <EdgeType extends Edge = Edge>(element: unknown): element
// eslint-disable-next-line @typescript-eslint/ban-types
export function fixedForwardRef<T, P = {}>(
render: (props: P, ref: Ref<T>) => ReactNode
): (props: P & RefAttributes<T>) => ReactNode {
render: (props: P, ref: Ref<T>) => JSX.Element
): (props: P & RefAttributes<T>) => JSX.Element {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return forwardRef(render) as any;
}