Skip to content
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

Allow getUserConfirmation callback result to cater for any type of value #611

Closed
wants to merge 4 commits into from
Closed

Conversation

mymattcarroll
Copy link

@mymattcarroll mymattcarroll commented Jul 26, 2018

Closes #489

We'd like to have a multi-option confirmation popup (save/discard/cancel) and need a way to pass additional details about the actions, and an action handler into getUserConfirmation.

The changes proposed will not break compatibility but will allow for any type of value returned from the callback.

@mymattcarroll
Copy link
Author

@mjackson, any chance of getting this merged? We would really like this feature in https://github.com/FormidableLabs/redux-little-router

@mjackson
Copy link
Member

mjackson commented Sep 9, 2019

Hey @mymattcarroll, thanks for the PR. And my apologies for the long delay following up. Can you please describe a bit more about what you're trying to do? The getUserConfirmation method is giving a lot of people trouble, so I'm currently on the look-out for a better solution.

@mymattcarroll
Copy link
Author

mymattcarroll commented Sep 10, 2019

@mjackson as this was quite a while ago, I don't remember the exact use case but we wanted to pass a more complex object as the result which was more than just JSON so we could not stringify it either. If you need more information, I might have to wait until the weekend to dig back into the code base we were using this lib in.

@mjackson
Copy link
Member

No worries. I just figured I'd ask to see if you remembered off the top of your head.

We are actually planning on removing getUserConfirmation in the future because it forces you to declare a function up front when you create your history object instead of being able to define a function where you do the block. That's probably the reason you had to pass some extra information through getUserConfirmation, so you could access the context you were in when you blocked the navigation attempt. This will be a lot more straightforward in the future.

@mjackson mjackson closed this Sep 12, 2019
@mymattcarroll
Copy link
Author

Yep, I think that was exactly the issue we were having. Looking forward to the update. :)

@lock lock bot locked as resolved and limited conversation to collaborators Nov 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

confirmTransitionTo prompt require type string, maybe it shouldn't?
2 participants