Skip to content

Instantly share code, notes, and snippets.

View Maycon-Santos's full-sized avatar
🏠
Working from home

Maycon Santos Maycon-Santos

🏠
Working from home
View GitHub Profile
@mateusvahl
mateusvahl / Box.tsx
Last active March 20, 2024 13:21
React / Typescript Dynamic tag with intellisense autocomplete
import { ReactNode, ElementType, ComponentPropsWithoutRef } from "react";
export type Prefer<P, T> = P & Omit<T, keyof P>;
export type ElementPropsWithoutRef<T extends ElementType> = Pick<
ComponentPropsWithoutRef<T>,
keyof ComponentPropsWithoutRef<T>
>;
export type OverwritableType<OwnProps, Type extends ElementType> = Prefer<