@openmrs/esm-react-utils 4.1.1-pre.553 → 4.1.1-pre.557

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-react-utils",
3
- "version": "4.1.1-pre.553",
3
+ "version": "4.1.1-pre.557",
4
4
  "license": "MPL-2.0",
5
5
  "description": "React utilities for OpenMRS.",
6
6
  "browser": "dist/openmrs-esm-react-utils.js",
@@ -55,11 +55,11 @@
55
55
  "react-i18next": "11.x"
56
56
  },
57
57
  "devDependencies": {
58
- "@openmrs/esm-api": "^4.1.1-pre.553",
59
- "@openmrs/esm-config": "^4.1.1-pre.553",
60
- "@openmrs/esm-error-handling": "^4.1.1-pre.553",
61
- "@openmrs/esm-extensions": "^4.1.1-pre.553",
62
- "@openmrs/esm-globals": "^4.1.1-pre.553",
58
+ "@openmrs/esm-api": "^4.1.1-pre.557",
59
+ "@openmrs/esm-config": "^4.1.1-pre.557",
60
+ "@openmrs/esm-error-handling": "^4.1.1-pre.557",
61
+ "@openmrs/esm-extensions": "^4.1.1-pre.557",
62
+ "@openmrs/esm-globals": "^4.1.1-pre.557",
63
63
  "dayjs": "^1.10.8",
64
64
  "i18next": "^19.6.0",
65
65
  "jest": "28.1.0",
@@ -71,5 +71,5 @@
71
71
  "rxjs": "^6.5.3",
72
72
  "unistore": "^3.5.2"
73
73
  },
74
- "gitHead": "118e2fa5ee52ec25bea6e9c0ab5cd39a51669af0"
74
+ "gitHead": "34fdcf29979501096ec3e0dda472852935b0d525"
75
75
  }
package/src/useConfig.ts CHANGED
@@ -160,7 +160,9 @@ function useNormalConfig(moduleName: string) {
160
160
  /**
161
161
  * Use this React Hook to obtain your module's configuration.
162
162
  */
163
- export function useConfig() {
163
+ export function useConfig<
164
+ T = Omit<ConfigObject, "Display conditions" | "Translation overrides">
165
+ >() {
164
166
  // This hook uses the config of the MF defining the component.
165
167
  // If the component is used in an extension slot then the slot
166
168
  // may override (part of) its configuration.
@@ -180,5 +182,5 @@ export function useConfig() {
180
182
  [normalConfig, extensionConfig]
181
183
  );
182
184
 
183
- return config;
185
+ return config as T;
184
186
  }