TanStackT
TanStack2mo ago
3 replies
broad-salmon

Block/Confirm Navigation TO A PAGE

I'm using file-based-routing and I have a requirement to show a confirmation modal every time a navigation attempt is made TO a specific page (suppose '/users'). The users page should not even load unless user clicks 'proceed' in the modal. If user clicks 'cancel' he should remain where he was (navigation wise).
I tired beforeload / loader functions in the createFileRoute function, but couldn't find the exact setup that would work. Ideas? Thanks
Was this page helpful?