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

What is the proper way to make navigation.goBack action to be processed immediately?

$
0
0

Due to the nature of our app, it has some heavy data traffic over the bridge between native and javascript thread.

To decrease this communication over the bridge and moving some js implementations to the native side is another concern but for the sake of the smooth user experience, i wanted to give some priority to react-navigation events so they can be processed first just to achieve to increase its perceived performance by the user.

I mean whenever a user wants to return the previous screen and press the go-back button for this purpose, going back must be immediate despite the bridge being busy with other stuff.

Here is my simple implementation of back button and onPress event. It simply fire navigation.goBack(null) but when my app is busy with processing other things, goBack action is delayed almost 1-2 seconds. This leads a bad user experience.

  import { HeaderBackButton } from 'react-navigation-stack';  ...  const goBackAction = () => { navigation.goBack(null); };  headerOptions.headerLeft = () => <HeaderBackButton onPress={goBackAction} />;  ...

Can i give priority to react navigation.goBack action to be processed immediately?


Viewing all articles
Browse latest Browse all 6214

Trending Articles



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