mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 14:13:43 +01:00
Merge pull request #23940 from overleaf/td-react-18
Upgrade to React 18 GitOrigin-RevId: 9b81936e6eea2bccd97fe5c2c5841f0b946371b8
This commit is contained in:
@@ -1,16 +1,23 @@
|
||||
import { forwardRef } from 'react'
|
||||
import {
|
||||
forwardRef,
|
||||
PropsWithoutRef,
|
||||
ReactElement,
|
||||
Ref,
|
||||
RefAttributes,
|
||||
FunctionComponent,
|
||||
} from 'react'
|
||||
|
||||
export const fixedForwardRef = <
|
||||
T,
|
||||
P = object,
|
||||
A extends Record<string, React.FunctionComponent> = Record<
|
||||
A extends Record<string, FunctionComponent> = Record<
|
||||
string,
|
||||
React.FunctionComponent
|
||||
FunctionComponent
|
||||
>,
|
||||
>(
|
||||
render: (props: P, ref: React.Ref<T>) => React.ReactElement | null,
|
||||
render: (props: PropsWithoutRef<P>, ref: Ref<T>) => ReactElement | null,
|
||||
propsToAttach: A = {} as A
|
||||
): ((props: P & React.RefAttributes<T>) => React.ReactElement | null) & A => {
|
||||
): ((props: P & RefAttributes<T>) => ReactElement | null) & A => {
|
||||
const ForwardReferredComponent = forwardRef(render) as any
|
||||
|
||||
for (const i in propsToAttach) {
|
||||
|
||||
Reference in New Issue
Block a user