Q: How to store route in react-native with react-navigation? I'm trying to make react-navigation remember user path.
So, it's saved where users are in redux.
This is for when the user clicks a back button, and pop the screen with LIFO way.
I wonder if what I'm trying to do is the correct way.
The problem is that my way causes when the touchable thing is clicked multiple times.
If it clicked multiple times, that method which is related to stack the path where the user is is called multiple times and stacked the path multiple times in the redux array.
Here's my code.

clicked() method makes clicked state to true.
init_clicked() method makes clicked state to false.
mainScreen.js
/*
if click button then call moveToFavorite method.
*/

moveToFavorite = async () => {
        const {fetching, ScreenActions, navigation, clicked} = this.props;
        const {push, navigate} = navigation;
/*currunt state 
{
    userPath: [],
    clicked: false
} 
*/
        if(!clicked) {
            ScreenActions.clicked();
            await ScreenActions.stackScreen('favorite'); // save the path name, 'favorite' to redux

/* state
{
    userPath: ['favorite'],
    clicked: false <= but what I expect was it should be 'true'

so it can make clicking multiple times.
if click twice then, userPath is ['favorite', 'favorite']

}
*/
            navigate('FavoriteScreen');
        }
    }

favoriteScreen.js
componentDidMount() {
        const {navigation, ScreenActions} = this.props;
        ScreenActions.init_clicked(); // this one executes earlier than the ScreenActions.clicked() in favoriteScreen.js
//That's why state clicked state is changed to false right away.
    }

