Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

React Native - Handle session timeout after any api call

$
0
0

I have a complex react-native application and I'm using .net api for backend. When session timeout occurs on api side, I want to automatically logout the user and return to login page. But I can't use dispatch in the class that I'm doing api call. Because its not a component or a redux file. To navigate to the login page I need to dispatch some actions. Is there a way to do is? If I use Redux-Toolkit, does it work? I am looking for an easier solution because start using Redux toolkit in the project is a big effort for me right now.

Here is my project's structure:

enter image description here

Thanks in advance.


Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>