@trackunit/react-graphql-hooks 1.3.24 → 1.3.28

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/index.cjs.js CHANGED
@@ -136,7 +136,7 @@ const unionEdgesByNodeKey = (key, previousEdges, newEdges) => {
136
136
  const usePaginationQuery = (document, { ...props }) => {
137
137
  const [lastFetchedData, setLastFetchedData] = react.useState();
138
138
  const [resetTrigger, setResetTrigger] = react.useState(0);
139
- const [abortController, setAbortController] = react.useState(new AbortController());
139
+ const [abortController] = react.useState(new AbortController());
140
140
  // Makes **sure** query variables are stable.
141
141
  // Before, it required variables to always be memorized in the parent which was easy to forget and confusing.
142
142
  // Maybe better solution exists but this is the best I could come up with without changing to much.
@@ -264,16 +264,6 @@ const usePaginationQuery = (document, { ...props }) => {
264
264
  }
265
265
  // eslint-disable-next-line react-hooks/exhaustive-deps
266
266
  }, [after]);
267
- react.useEffect(() => {
268
- return () => {
269
- abortController.abort();
270
- setAbortController(new AbortController());
271
- };
272
- },
273
- // Due to issues with StritMode and useEffect cleanup, we need to disable the exhaustive-deps rule here.
274
- // For some reason, when the rule is enabled, the cleanup function is not called when the component is unmounted properly.
275
- // eslint-disable-next-line react-hooks/exhaustive-deps
276
- []);
277
267
  return react.useMemo(() => {
278
268
  return {
279
269
  data,
package/index.esm.js CHANGED
@@ -115,7 +115,7 @@ const unionEdgesByNodeKey = (key, previousEdges, newEdges) => {
115
115
  const usePaginationQuery = (document, { ...props }) => {
116
116
  const [lastFetchedData, setLastFetchedData] = useState();
117
117
  const [resetTrigger, setResetTrigger] = useState(0);
118
- const [abortController, setAbortController] = useState(new AbortController());
118
+ const [abortController] = useState(new AbortController());
119
119
  // Makes **sure** query variables are stable.
120
120
  // Before, it required variables to always be memorized in the parent which was easy to forget and confusing.
121
121
  // Maybe better solution exists but this is the best I could come up with without changing to much.
@@ -243,16 +243,6 @@ const usePaginationQuery = (document, { ...props }) => {
243
243
  }
244
244
  // eslint-disable-next-line react-hooks/exhaustive-deps
245
245
  }, [after]);
246
- useEffect(() => {
247
- return () => {
248
- abortController.abort();
249
- setAbortController(new AbortController());
250
- };
251
- },
252
- // Due to issues with StritMode and useEffect cleanup, we need to disable the exhaustive-deps rule here.
253
- // For some reason, when the rule is enabled, the cleanup function is not called when the component is unmounted properly.
254
- // eslint-disable-next-line react-hooks/exhaustive-deps
255
- []);
256
246
  return useMemo(() => {
257
247
  return {
258
248
  data,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-graphql-hooks",
3
- "version": "1.3.24",
3
+ "version": "1.3.28",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -8,11 +8,11 @@
8
8
  },
9
9
  "dependencies": {
10
10
  "@apollo/client": "3.10.4",
11
- "react": "18.3.1",
11
+ "react": "19.0.0",
12
12
  "lodash": "4.17.21",
13
- "@trackunit/i18n-library-translation": "1.3.24",
14
- "@trackunit/shared-utils": "1.5.23",
15
- "@trackunit/react-table-pagination": "1.3.23"
13
+ "@trackunit/i18n-library-translation": "1.3.28",
14
+ "@trackunit/shared-utils": "1.5.27",
15
+ "@trackunit/react-table-pagination": "1.3.27"
16
16
  },
17
17
  "module": "./index.esm.js",
18
18
  "main": "./index.cjs.js",