Normally, if your server responds with 401, it means that the user is making a request that they should not have been able to make. They have tried to access an endpoint which they were not authorized to access.
The way this is normally prevented, is by separating your react routes into private routes and not private. Think of this as a client side middleware. To create private routes check this article https://medium.com/@bhairabpatra.iitd/private-routes-in-react-559a7d8d161f
On the other hand, if you have an api call that returns 401 and you want to redirect the user to /login if that is the response status code, you would have to manually redirect the user every time. It really should not be too much code.