UNPKG

@primer/react

Version:

An implementation of GitHub's Primer Design System using React

19 lines (18 loc) 580 B
import { forwardRef } from "react"; //#region src/utils/modern-polymorphic.ts /** * Distributive Omit utility type that works correctly with union types */ /** * Fixed version of forwardRef that provides better type inference for polymorphic components */ /** * Cast forwardRef to the fixed version with better type inference */ const fixedForwardRef = forwardRef; /** * Simplified polymorphic props type that handles the common pattern of * `DistributiveOmit<ComponentPropsWithRef<ElementType extends As ? DefaultElement : As>, 'as'>` */ //#endregion export { fixedForwardRef };