UNPKG

reactement

Version:

Sometimes it's useful to let the DOM render our components when needed. Custom Elements are great at this. They provide various methods that can inform you when an element is "connected" or "disconnected" from the DOM.

13 lines (12 loc) 537 B
import { ComponentFactory } from 'react'; type ComponentFunction<P = {}> = () => ComponentResult<P>; type ComponentResult<P = {}> = ComponentFactory<P, any> | ComponentAsync<P>; type ComponentAsync<P = {}> = Promise<ComponentFactory<P, any>> | Promise<{ [index: string]: ComponentFactory<P, any>; }>; interface IOptions { attributes?: string[]; formatProps?: <P = any>(props: P) => P; wrapComponent?: <P>(child: ComponentFactory<P, any>) => any; } export { IOptions, ComponentFunction, ComponentResult, ComponentAsync };