O3 Framework / getSyncLifecycle
getSyncLifecycle<
T>(Component,options): () =>Promise<ReactAppOrParcel<T>>
Defined in: packages/framework/esm-react-utils/src/getLifecycle.ts:77
Creates a single-spa lifecycle for a React component that is already loaded. Unlike getAsyncLifecycle, this wraps a synchronously-available component in a Promise to match the expected lifecycle interface. Use this when the component doesn’t need lazy loading.
T
ComponentType<T>
The React component to create a lifecycle for.
ComponentDecoratorOptions
Configuration options for the OpenMRS component decorator.
A function that returns a Promise resolving to a single-spa lifecycle object.
():
Promise<ReactAppOrParcel<T>>
Promise<ReactAppOrParcel<T>>
import { getSyncLifecycle } from '@openmrs/esm-framework';
import MyComponent from './MyComponent';
const options = { featureName: 'my-feature', moduleName: '@openmrs/esm-my-app' };
export const myExtension = getSyncLifecycle(MyComponent, options);