React.js cms redirection

Hi, currently I am running a next.js blog page with react.js framework integration is hosted on GitHub, but I am struggling how to redirect users from pages to another page like to a custom “”, I have tried in post code like this one below but it doesn’t work here’s the example I have tried:

Anyone could help me how can I redirect?

Thank you.

Hello @ermaleagle1 and welcome to the community!

You can’t write JS code inside the CMS to be executed on your site, as that job should be delegated to the front end.
So if you are using NextJS you can redirect using their available tools for it, but if you are only using React without NextJS then you are going to need to use the React Router package to redirect users.
Here is a short step by step tutorial on how to use react router to redirect users: How to redirect to another page in ReactJS ? - GeeksforGeeks