Thank you for your reply. But I'm a solo developer been using asp.net mvc since version 3. separating the UI and backend will be a lot of work for me. Is it really necessary?
Okay, so you do not want to change because it is too much work. That's fine. Stick with what you know.
If I remain to use razor pages what javascript library or framework should I use?
You're asking this question as if there is a magical unifying framework. Make a list of the required features and pick a JavaScript library that supports the requirements. As stated above, vanilla JavaScript works across all browsers these days. So plain old JavaScript is an option.
Should I jumpship to backend: asp.net web api(.net 6), frontend: (typescript + react)? will that be a lot more to work on? Should I remain to use razor pages?
It's up to you. I went with React a few years ago because it was easy to integrate React into an existing web application.
Do a bit of experimentation to find what works for you.