-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: react-router-redux ignores custom getUserConfirmation #5286
Comments
getUserConfirmation is actually a history API. We just pass through to the history creation function. Since you're making your own history instance, you can just pass it in to that: https://github.com/ReactTraining/history#customizing-the-confirm-dialog |
Oh, I wasn't aware of that. Thanks for the heads-up! |
@bummzack did this custom getUserConfirmation work for you? |
@amanmehta25 I found |
Thanks a lot, @bummzack. That really worked for me. |
Version
react-router: 4.1.1
react-router-redux: 5.0.0-alpha.6
Test Case
https://codepen.io/anon/pen/gRXzMg
With the above test-case, navigate to "Prompt", enter something into the input-field and then navigate to "Home". The confirm dialog should read "THIS IS A CUSTOM MESSAGE", but it doesn't.
Steps to reproduce
Set the
getUserConfirmation
on theConnectedRouter
to be something different than the default behavior.Trigger a confirmation via
Prompt
component, instead of the customgetUserConfirmation
function, the default implementation will always be called.Expected Behavior
The
ConnectedRouter
should also use the customgetUserConfirmation
instead of the default implementation.Actual Behavior
The default implementation (eg. using
window.confirm
) is used, even whengetUserConfirmation
is set.The text was updated successfully, but these errors were encountered: