O3 Framework / getLifecycle
getLifecycle<
T>(Component,options):ReactAppOrParcel<T>
Defined in: packages/framework/esm-react-utils/src/getLifecycle.ts:26
Creates a single-spa lifecycle object for a React component. The component is wrapped with the OpenMRS component decorator which provides standard functionality like error boundaries, configuration, and extension support.
T
ComponentType<T>
The React component to create a lifecycle for.
ComponentDecoratorOptions
Configuration options for the OpenMRS component decorator.
ReactAppOrParcel<T>
A single-spa lifecycle object with bootstrap, mount, and unmount functions.
import { getLifecycle } from '@openmrs/esm-framework';
import MyComponent from './MyComponent';
export const lifecycle = getLifecycle(MyComponent, { featureName: 'my-feature', moduleName: '@openmrs/esm-my-app' });