@pdg/react-hook 1.0.32 → 1.0.34

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.esm.js CHANGED
@@ -142,6 +142,7 @@ function ifUndefined(v, v2) {
142
142
  if (initialValue === void 0) { initialValue = true; }
143
143
  var isMountedRef = useRef(initialValue);
144
144
  useEffect(function () {
145
+ isMountedRef.current = true;
145
146
  return function () {
146
147
  isMountedRef.current = false;
147
148
  };
package/dist/index.js CHANGED
@@ -142,6 +142,7 @@ function ifUndefined(v, v2) {
142
142
  if (initialValue === void 0) { initialValue = true; }
143
143
  var isMountedRef = react.useRef(initialValue);
144
144
  react.useEffect(function () {
145
+ isMountedRef.current = true;
145
146
  return function () {
146
147
  isMountedRef.current = false;
147
148
  };
@@ -1,4 +1,5 @@
1
1
  import { RefObject, SetStateAction } from 'react';
2
+ export declare function useAutoUpdateRefState<T extends readonly any[] | undefined | null>(state: T): [RefObject<T>, T, (value: SetStateAction<T>) => T];
2
3
  export declare function useAutoUpdateRefState<T>(state: Exclude<T, (...args: any[]) => any>): [RefObject<T>, T, (value: SetStateAction<T>) => T];
3
4
  export declare function useAutoUpdateRefState<T>(state: Exclude<T, (...args: any[]) => any>, callback: (state: T) => T): [RefObject<T>, T, (value: SetStateAction<T>, skipCallback?: boolean) => T];
4
5
  export declare function useAutoUpdateRefState<T = never, StateT = never>(state: Exclude<StateT, (...args: any[]) => any>, callback: (state: T | StateT) => T extends never ? StateT : T): [
@@ -1,4 +1,5 @@
1
1
  import { SetStateAction } from 'react';
2
+ export declare function useAutoUpdateState<T extends readonly any[] | undefined | null>(state: T): [T, (value: SetStateAction<T>) => T];
2
3
  export declare function useAutoUpdateState<T>(state: Exclude<T, (...args: any[]) => any>): [T, (value: SetStateAction<T>) => T];
3
4
  export declare function useAutoUpdateState<T>(state: Exclude<T, (...args: any[]) => any>, callback: (state: T) => T): [T, (value: SetStateAction<T>, skipCallback?: boolean) => T];
4
5
  export declare function useAutoUpdateState<T = never, StateT = never>(state: Exclude<StateT, (...args: any[]) => any>, callback: (state: T | StateT) => T extends never ? StateT : T): [
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pdg/react-hook",
3
3
  "title": "React Hook",
4
- "version": "1.0.32",
4
+ "version": "1.0.34",
5
5
  "description": "React Hook",
6
6
  "type": "module",
7
7
  "types": "dist/index.d.ts",