@geee-be/react-utils 1.0.6 → 1.0.7

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @geee-be/react-utils
2
2
 
3
+ ## 1.0.7
4
+
5
+ ### Patch Changes
6
+
7
+ - 59874a9: if (typeof history === 'undefined')
8
+
3
9
  ## 1.0.6
4
10
 
5
11
  ### Patch Changes
@@ -2,7 +2,7 @@
2
2
  import { useEffect, useState } from 'react';
3
3
  import { deserialize, getInitialValue, serialize } from './state.util.js';
4
4
  export const useHistoryState = (key, initialValue, replace = true, options) => {
5
- if (!history) {
5
+ if (typeof history === 'undefined') {
6
6
  // eslint-disable-next-line @typescript-eslint/no-unsafe-return
7
7
  return [undefined, () => { }];
8
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geee-be/react-utils",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -11,7 +11,7 @@ export const useHistoryState = <T, S = T>(
11
11
  replace = true,
12
12
  options?: SerializationOptions<T, S>,
13
13
  ): [T, Dispatch<SetStateAction<T>>] => {
14
- if (!history) {
14
+ if (typeof history === 'undefined') {
15
15
  // eslint-disable-next-line @typescript-eslint/no-unsafe-return
16
16
  return [undefined as any, () => {}];
17
17
  }