@ledgerhq/lumen-utils-shared 0.0.18 → 0.0.19

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/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsx as W } from "react/jsx-runtime";
2
- import { createContext as k, useMemo as A, useContext as F } from "react";
2
+ import { createContext as k, useMemo as A, use as F } from "react";
3
3
  import { clsx as _ } from "clsx";
4
4
  import { twMerge as j } from "tailwind-merge";
5
5
  function q(t) {
@@ -45,7 +45,7 @@ function J(t, n) {
45
45
  () => i,
46
46
  Object.values(i ?? {})
47
47
  );
48
- return /* @__PURE__ */ W(l.Provider, { value: e, children: c });
48
+ return /* @__PURE__ */ W(l, { value: e, children: c });
49
49
  };
50
50
  o.displayName = t + "Provider";
51
51
  function r({
@@ -1 +1 @@
1
- {"version":3,"file":"createSafeContext.d.ts","sourceRoot":"","sources":["../../../src/lib/createSafeContext/createSafeContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,EAAE,EAAE,SAAS,EAAuB,MAAM,OAAO,CAAC;AAE1E,wBAAgB,iBAAiB,CAAC,YAAY,SAAS,MAAM,EAC3D,iBAAiB,EAAE,MAAM,EACzB,cAAc,CAAC,EAAE,YAAY;cAKjB,SAAS;WACZ,YAAY;KAaG,eAAe,SAAS,OAAO,gDAGpD;IACD,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,eAAe,CAAC;CAClC,KAAG,eAAe,SAAS,IAAI,GAAG,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,EAgBxE"}
1
+ {"version":3,"file":"createSafeContext.d.ts","sourceRoot":"","sources":["../../../src/lib/createSafeContext/createSafeContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,EAAE,EAAE,SAAS,EAAgB,MAAM,OAAO,CAAC;AAEnE,wBAAgB,iBAAiB,CAAC,YAAY,SAAS,MAAM,EAC3D,iBAAiB,EAAE,MAAM,EACzB,cAAc,CAAC,EAAE,YAAY;cAKjB,SAAS;WACZ,YAAY;KAaG,eAAe,SAAS,OAAO,gDAGpD;IACD,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,eAAe,CAAC;CAClC,KAAG,eAAe,SAAS,IAAI,GAAG,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,EAgBxE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/lumen-utils-shared",
3
- "version": "0.0.18",
3
+ "version": "0.0.19",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -1,4 +1,4 @@
1
- import { createContext, FC, ReactNode, useContext, useMemo } from 'react';
1
+ import { createContext, FC, ReactNode, use, useMemo } from 'react';
2
2
 
3
3
  export function createSafeContext<ContextValue extends object>(
4
4
  rootComponentName: string,
@@ -16,7 +16,7 @@ export function createSafeContext<ContextValue extends object>(
16
16
  Object.values(context ?? {}),
17
17
  ) as ContextValue;
18
18
 
19
- return <Context.Provider value={memoValue}>{children}</Context.Provider>;
19
+ return <Context value={memoValue}>{children}</Context>;
20
20
  };
21
21
 
22
22
  Provider.displayName = rootComponentName + 'Provider';
@@ -28,7 +28,7 @@ export function createSafeContext<ContextValue extends object>(
28
28
  consumerName: string;
29
29
  contextRequired: ContextRequired;
30
30
  }): ContextRequired extends true ? ContextValue : Partial<ContextValue> {
31
- const context = useContext(Context);
31
+ const context = use(Context);
32
32
 
33
33
  if (context) {
34
34
  return context;