Next.js Discord

Discord Forum

Next safe action onSuccess and onError is not working.

Answered
Spectacled Caiman posted this in #help-forum
Open in Discord
Spectacled CaimanOP
I'm trying next safe action, but onSuccess and onError in not called. Anyone have idea how to solve this?
    const { execute, isExecuting } = useAction(authCheckRegisteredAction, {
        onSuccess: (result) => {
            console.log('This not called');
            console.log(result.data);
        },
        onError: (error) => {
            console.log('This also not called.');
            console.error(error);
        }
    });
Answered by Spectacled Caiman
It turns out that I need to reload the page first.
View full answer

1 Reply

Spectacled CaimanOP
It turns out that I need to reload the page first.
Answer