@shipengine/react-api 2.0.1 → 2.0.2

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.
Files changed (3) hide show
  1. package/index.js +1 -1
  2. package/index.mjs +1 -1
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -15,6 +15,7 @@ const ShipEngine = ({
15
15
  getToken,
16
16
  onApiError
17
17
  }) => {
18
+ const [queryClient] = react.useState(() => new reactQuery.QueryClient());
18
19
  const [client, setClient] = react.useState(() => {
19
20
  const token = getToken();
20
21
  if (typeof token === "string")
@@ -36,7 +37,6 @@ const ShipEngine = ({
36
37
  );
37
38
  return void 0;
38
39
  });
39
- const queryClient = new reactQuery.QueryClient();
40
40
  if (!client) {
41
41
  return /* @__PURE__ */ jsxRuntime.jsx(
42
42
  "div",
package/index.mjs CHANGED
@@ -12,6 +12,7 @@ const ShipEngine = ({
12
12
  getToken,
13
13
  onApiError
14
14
  }) => {
15
+ const [queryClient] = useState(() => new QueryClient());
15
16
  const [client, setClient] = useState(() => {
16
17
  const token = getToken();
17
18
  if (typeof token === "string")
@@ -33,7 +34,6 @@ const ShipEngine = ({
33
34
  );
34
35
  return void 0;
35
36
  });
36
- const queryClient = new QueryClient();
37
37
  if (!client) {
38
38
  return /* @__PURE__ */ jsx(
39
39
  "div",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipengine/react-api",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {