Skip to content

Instantly share code, notes, and snippets.

@athospg
Created October 10, 2022 16:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save athospg/7998099c5a95b8fbe384a6a88140c605 to your computer and use it in GitHub Desktop.
Save athospg/7998099c5a95b8fbe384a6a88140c605 to your computer and use it in GitHub Desktop.
React forwardRef with generic type
declare module 'react' {
function forwardRef<T, P = {}>(
render: (props: P, ref: React.Ref<T>) => React.ReactElement | null,
): (props: P & React.RefAttributes<T>) => React.ReactElement | null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment