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?