react-code-canvas
Version:
Package to run and preview React code with live editing capabilities in a browser.
8 lines (7 loc) • 349 B
TypeScript
import React, { ComponentPropsWithoutRef, ElementType } from 'react';
export type LivePreviewProps<T extends ElementType = 'div'> = ({
Component: T;
} | {
Component?: 'div';
}) & ComponentPropsWithoutRef<T>;
export declare const LivePreview: <T extends ElementType = "div">({ Component, ...rest }: LivePreviewProps<T>) => React.JSX.Element;