openmrs-esm-core

O3 Framework / OpenmrsAppContext

Function: OpenmrsAppContext()

OpenmrsAppContext<T>(__namedParameters): null

Defined in: packages/framework/esm-react-utils/src/OpenmrsContext.ts:24

OpenmrsAppContext is a simple React component meant to function similarly to React’s Context, but built on top of the OpenmrsAppContext.

Type Parameters

T

T extends object = object

Parameters

__namedParameters

OpenmrsAppContextProps<T>

Returns

null

Example

   <OpenmrsAppContext namespace="something" value= />

Notes on usage: Unlike a proper React context where the value is limited to the subtree under the context component, the OpenmrsAppContext is inherently global in scope. That means that all applications will see the values that you set for the namespace if they load the value of the namespace.