@openmrs/esm-react-utils 4.1.1-pre.528 → 4.1.1-pre.531

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.528",
3
+ "version": "4.1.1-pre.531",
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.528",
59
- "@openmrs/esm-config": "^4.1.1-pre.528",
60
- "@openmrs/esm-error-handling": "^4.1.1-pre.528",
61
- "@openmrs/esm-extensions": "^4.1.1-pre.528",
62
- "@openmrs/esm-globals": "^4.1.1-pre.528",
58
+ "@openmrs/esm-api": "^4.1.1-pre.531",
59
+ "@openmrs/esm-config": "^4.1.1-pre.531",
60
+ "@openmrs/esm-error-handling": "^4.1.1-pre.531",
61
+ "@openmrs/esm-extensions": "^4.1.1-pre.531",
62
+ "@openmrs/esm-globals": "^4.1.1-pre.531",
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": "7e332eb05c0b81a8f091681e741b8315954c087b"
74
+ "gitHead": "780dde6d84e446602e28fda1e78779c21ad5648f"
75
75
  }
package/src/Extension.tsx CHANGED
@@ -20,7 +20,7 @@ export type ExtensionProps = {
20
20
  } & Omit<React.HTMLAttributes<HTMLDivElement>, "children"> & {
21
21
  children?:
22
22
  | React.ReactNode
23
- | ((extension: React.ReactNode) => React.ReactNode);
23
+ | ((slot: React.ReactNode, extension?: ExtensionData) => React.ReactNode);
24
24
  };
25
25
 
26
26
  /**
@@ -54,7 +54,7 @@ export const Extension: React.FC<ExtensionProps> = ({
54
54
  );
55
55
  }
56
56
  // we only warn when component mounts
57
- // eslint-disable-next-line eslintreact-hooks/exhaustive-deps
57
+ // eslint-disable-next-line react-hooks/exhaustive-deps
58
58
  }, []);
59
59
 
60
60
  const ref = useCallback(
@@ -105,7 +105,7 @@ export const Extension: React.FC<ExtensionProps> = ({
105
105
 
106
106
  // we intentionally do not re-run this hook if state gets updated
107
107
  // state updates are handled in the next useEffect hook
108
- // eslint-disable-next-line eslintreact-hooks/exhaustive-deps
108
+ // eslint-disable-next-line react-hooks/exhaustive-deps
109
109
  }, [
110
110
  extension?.extensionSlotName,
111
111
  extension?.extensionId,
@@ -129,7 +129,7 @@ export const Extension: React.FC<ExtensionProps> = ({
129
129
  return () => {
130
130
  updatePromise.current = null;
131
131
  };
132
- }, [parcel.current, state]);
132
+ }, [state]);
133
133
 
134
134
  // The extension is rendered into the `<div>`. The `<div>` has relative
135
135
  // positioning in order to allow the UI Editor to absolutely position
@@ -143,8 +143,8 @@ export const Extension: React.FC<ExtensionProps> = ({
143
143
  />
144
144
  );
145
145
 
146
- if (typeof children == "function" && !React.isValidElement(children)) {
147
- return <>{children(slot)}</>;
146
+ if (typeof children === "function" && !React.isValidElement(children)) {
147
+ return <>{children(slot, extension)}</>;
148
148
  }
149
149
 
150
150
  return extension && wrap ? wrap(slot, extension) : slot;