-
Notifications
You must be signed in to change notification settings - Fork 2
"Changes may not be saved" Dialog for Equipment Editor Page #1145
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
base: main
Are you sure you want to change the base?
"Changes may not be saved" Dialog for Equipment Editor Page #1145
Conversation
client/src/pages/makerspace_page/equipment_pages/EquipmentInformation.tsx
Outdated
Show resolved
Hide resolved
cowsed
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to work for reloading the page which is good, but not for switching to different pages
(click on equipment edit, change a text box, press the manage trainings button).
after a little bit of research it looks like you have to use useBlocker to tie into the react router https://reactrouter.com/api/hooks/useBlocker
|
I'm stuck and running into issues with trying to implement useBlocker (and even usePrompt). The page shows up blank and I get a long, vague "Uncaught Error" in the console. Just to get the functionality in, I plan on doing some work-around. Once that's settled, I want to investigate more and try to put useBlocker back in. |
So I'm reluctant to (because I don't want to make any risky changes), but I would have to switch to using Thoughts, @cowsed ? Should I try to use |
|
Hmmm, from what i can see it looks like createBrowserRouter is the new recommended way of doing things and gives us more features like blocking pages and more. we just have to make sure we test all the pages especially ones with more complicated url formats |
Old code is commented out just in case we need it again.
Closes: #1123
Closes: #1090