DEV Community

Rafael Borges
Rafael Borges

Posted on

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.