UNPKG

react-code-canvas

Version:

Package to run and preview React code with live editing capabilities in a browser.

12 lines (11 loc) 434 B
import { ReactElement } from 'react'; import { RunnerOptions } from './types'; export type UseRunnerProps = RunnerOptions & { /** whether to cache previous element when error occurs with current code */ disableCache?: boolean; }; export type UseRunnerReturn = { element: ReactElement | null; error: string | null; }; export declare const useRunner: ({ code, scope, disableCache, }: UseRunnerProps) => UseRunnerReturn;