I am trying to use react-navigation 5 replace functionality, but it does not work as expected.
Let's say there are three components:
set-domain.js,auth.js,some-func.js
What I am trying:
in set-domain.js I set domain and do:
props.navigation.navigate('Auth');this navigates toauth.js:
in Auth I login and do:
props.navigation.replace('SomeFunc');this should replace tosome-func.js
Problem is that it does not replace, but it navigates (I have back button in header left and I can navigate back with back button). HOWEVER, if I use replace between set-domain.js, auth.js also, then it works for all screens.
What I am doing wrong here? It feels, that I do not understand how replace actually works, but I couldn't find more details on this in the documentation.
Thanks!