MCPcopy Create free account
hub / github.com/editablejs/editable / ComponentWithAs

Interface ComponentWithAs

apps/docs/src/utils/forward-ref-with-as.tsx:51–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49>
50
51export interface ComponentWithAs<ComponentType extends As, ComponentProps> {
52 // These types are a bit of a hack, but cover us in cases where the `as` prop
53 // is not a JSX string type. Makes the compiler happy so 🤷‍♂️
54 <TT extends As>(props: PropsWithAs<TT, ComponentProps>): React.ReactElement | null
55 (props: PropsWithAs<ComponentType, ComponentProps>): React.ReactElement | null
56
57 displayName?: string
58 propTypes?: React.WeakValidationMap<PropsWithAs<ComponentType, ComponentProps>>
59 contextTypes?: React.ValidationMap<any>
60 defaultProps?: Partial<PropsWithAs<ComponentType, ComponentProps>>
61}
62
63/**
64 * This is a hack for sure. The thing is, getting a component to intelligently

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…