Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I reload my page in remix run on a button click in an error boundary component

I have made an error boundary component in my remix app and have a retry button in it. But how do I add the functionality of reload? error boundary component is in root.tsx.

like image 759
Omama Zainab Avatar asked Nov 27 '25 18:11

Omama Zainab


1 Answers

Remember, Remix uses react-router under the hood.

const navigate = useNavigate()
const handleClick = () => {
  navigate('.', { replace: true })
}

https://reactrouter.com/docs/en/v6/hooks/use-navigate

like image 127
Kiliman Avatar answered Nov 30 '25 10:11

Kiliman



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!