UNPKG

@sanity/visual-editing

Version:

[![npm stat](https://img.shields.io/npm/dm/@sanity/visual-editing.svg?style=flat-square)](https://npm-stat.com/charts.html?package=@sanity/visual-editing) [![npm version](https://img.shields.io/npm/v/@sanity/visual-editing.svg?style=flat-square)](https://

15 lines (12 loc) 457 B
import type {ComponentProps} from 'react' import type {OverlayComponent, OverlayComponentProps} from '../types' // eslint-disable-next-line @typescript-eslint/no-explicit-any export function defineOverlayComponent<T extends OverlayComponent<Record<string, unknown>, any>>( component: T, props?: Omit<ComponentProps<T>, keyof OverlayComponentProps>, ): {component: T; props: typeof props} { return { component: component, props: props, } }