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.

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more