piral-core
Version:
The core library for creating a Piral instance.
11 lines • 442 B
JavaScript
import { useGlobalStateContext, useSetter } from '../hooks';
/**
* The component capable of setting a globally defined error handler component at mounting.
*/
export function SetError({ type, component, }) {
const { setErrorComponent } = useGlobalStateContext();
useSetter(() => component && setErrorComponent(type, component));
// tslint:disable-next-line:no-null-keyword
return null;
}
//# sourceMappingURL=SetError.js.map