Closed robertgorecki closed 1 year ago
@gabrielmontagne @cristiano-belloni what do you think about this guys?
@robertgorecki , very cool. Taking a look. Thanks. And yes, it'd be good to close that history.lock
old not-anymore-issue.
I pinged also @yerlanyr for an extra pair of eyes.
also @mamapitufo
I don't remember all the details, but lgtm
Looks good to me. I would also suggest to add a test to cover said use case.
Looks good to me. I would also suggest to add a test to cover said use case.
tests added
Cool, @robertgorecki -- I'm merging this. We can publish to NPM early next week.
Use case: User is filling in a form and before saving the details, he's clicking a link to navigate to different page. I'd like to be able to show him a notification that unsaved changes will be lost, so that he can decide if he wants to stay on this page or navigate away.
Problem:
caballo-vivo
is already usinghistory.block()
to control managed paths, so usinghistory.block()
within consuming app is breaking navigation for managed paths.Solution:
caballo-vivo
could export a method to block/unblock navigationExample usage as react hook: