MCPcopy
hub / github.com/kuma-ui/kuma-ui / forwardRef

Function forwardRef

packages/core/src/components/forwardRef.ts:31–46  ·  view source on GitHub ↗
(
  component: React.ForwardRefRenderFunction<
    React.ElementRef<Component>,
    React.PropsWithoutRef<
      Omit<React.ComponentPropsWithoutRef<Component>, keyof Props | "as"> &
        Props & {
          as?: As;
        }
    >
  >,
)

Source from the content-addressed store, hash-verified

29import { ComponentWithAs, As } from "./types";
30
31export function forwardRef<Props extends object, Component extends As>(
32 component: React.ForwardRefRenderFunction<
33 React.ElementRef<Component>,
34 React.PropsWithoutRef<
35 Omit<React.ComponentPropsWithoutRef<Component>, keyof Props | "as"> &
36 Props & {
37 as?: As;
38 }
39 >
40 >,
41): ComponentWithAs<Component, Props> {
42 return forwardReactRef(component) as unknown as ComponentWithAs<
43 Component,
44 Props
45 >;
46}

Callers 15

react.tsxFile · 0.90
react.tsxFile · 0.90
react.tsxFile · 0.90
react.tsxFile · 0.90
react.tsxFile · 0.90
react.tsxFile · 0.90
react.tsxFile · 0.90
react.tsxFile · 0.90
StaticBox.tsxFile · 0.90
DynamicBox.tsxFile · 0.90
index.tsxFile · 0.90
react.tsxFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected