DEV Community

Rafael Borges
Rafael Borges

Posted on

1

Not allow user click to back to before page through button of navigator with React

import { useNavigate } from 'react-router-dom'

const navigate = useNavigate()

navigate('/sign-in', { replace: true })

Enter fullscreen mode Exit fullscreen mode

Using replace true, the browser not allow back to back page after to navigate to sign-in route, how the example.

Top comments (1)

Collapse
 
twentyfour7 profile image
Ben Berfield

Hello Rafael.

We have reviewed your profile and find it impressive. If you are currently available for work, please reach out to me here. I have an exciting Blockchain project that I believe will capture your interest.

Looking forward to potentially collaborating with you on this project.

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay