when you use with that data is stored in the session so you cannot access it directly from your front-end react app. At least you should not be able to access it directly, because the front-end will expose your connection credentials and so on..
So if what you want to return is not secret of some sort, then you can return it back in the URL as query parameters and access them like that from your react component. But of course the best way to go for this will be an API call in my opinion. Again it depends what you need to do.