Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: TheEdoRan/next-safe-action
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v7.1.1
Choose a base ref
...
head repository: TheEdoRan/next-safe-action
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v7.1.2
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Jun 24, 2024

  1. fix(hooks): pass reset function to useCallback

    TheEdoRan committed Jun 24, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    AleksandrHovhannisyan Aleksandr Hovhannisyan
    Copy the full SHA
    b3e78bb View commit details
Showing with 4 additions and 4 deletions.
  1. +4 −4 packages/next-safe-action/src/hooks.ts
8 changes: 4 additions & 4 deletions packages/next-safe-action/src/hooks.ts
Original file line number Diff line number Diff line change
@@ -99,11 +99,11 @@ export const useAction = <
[safeActionFn]
);

const reset = () => {
const reset = React.useCallback(() => {
setIsIdle(true);
setClientInput(undefined);
setResult({});
};
}, []);

useActionCallbacks({
result: result ?? {},
@@ -219,11 +219,11 @@ export const useOptimisticAction = <
[safeActionFn, setOptimisticValue]
);

const reset = () => {
const reset = React.useCallback(() => {
setIsIdle(true);
setClientInput(undefined);
setResult({});
};
}, []);

useActionCallbacks({
result: result ?? {},