Skip to content

Instantly share code, notes, and snippets.

View rasulnavir's full-sized avatar
🕸️
Building things on the web

Rasul Navir rasulnavir

🕸️
Building things on the web
  • Baku, Azerbaijan
  • 16:54 (UTC +04:00)
View GitHub Profile
@rasulnavir
rasulnavir / forwardref-generics-18.ts
Created October 18, 2024 15:44 — forked from IrvingArmenta/forwardref-generics-18.ts
Example of a forward ref generic component in React 18
import React, { ForwardedRef, forwardRef, MouseEvent } from 'react';
type ClickableListProps<T> = {
items: T[];
onSelect: (
item: T,
event: MouseEvent<HTMLButtonElement, globalThis.MouseEvent>,
) => void;
};