sshyam-gupta / react-router-prompt

A replacement component for the react-router 6 `Prompt`. Allows for more flexible dialogs.

Home Page:https://codesandbox.io/s/react-router-prompt-example-react-router-6-7-y9ug7z?file=/src/App.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

resetConfirmation is always undefined

srflp opened this issue · comments

Hey,
this bit of code seems to do nothing.

const resetConfirmation = useCallback(() => {
() => setConfirm(initialConfirmState);
}, []);

Callback passed to useCallback returns nothing, so resetConfirmation is always undefined

Thanks @srflp for reporting issue here.
That's a good catch! This seems bug with multiple functions and so it is never invoked. We can remove one of the nested function.

Also the API doc is missing for this method.

I am swamped a bit now and so this is open for contribution. I can take up later if no one is available to pick.