piral-core
Version:
The core library for creating a Piral instance.
20 lines (19 loc) • 620 B
TypeScript
import * as React from 'react';
import { ErrorComponentsState } from '../types';
/**
* The props for the SetError component.
*/
export interface SetErrorProps<TKey extends keyof ErrorComponentsState> {
/**
* The name of the error component to set.
*/
type: TKey;
/**
* The error component to define.
*/
component: ErrorComponentsState[TKey];
}
/**
* The component capable of setting a globally defined error handler component at mounting.
*/
export declare function SetError<TKey extends keyof ErrorComponentsState>({ type, component, }: SetErrorProps<TKey>): React.ReactElement;