Tell us which versions you are using:
Hide back button text by using backTitle=""
Still displays back button title
For non-obvious bugs, please fork this component, modify Example project to reproduce your issue and include link here.
1.
2.
3.
Just use left={()=>null} to hide whole left/back button or just backTitle=' ' to make back button text invisible
@aksonov when I do backTitle=' ' , the back button always displays, including when there isn't a scene to navigate back to
As told in https://github.com/aksonov/react-native-router-flux/issues/2219, passing the prop backTitle = " " (_space in quotes_; NOT empty string) does the job
@y2k-shubham when I do that , the back button always displays, including when there isn't a scene to navigate back to
y2k-shubham's trick worked for me with:
"react-native": "0.53.3",
"react-native-router-flux": "^4.0.0-beta.28",
@g4laura this solution is meant to hide only the text along-side the back button and not the back button itself. While I haven't tried hiding the back button, see if https://github.com/aksonov/react-native-router-flux/issues/1509 can help. Better yet, give a try to @aksonov's solution by setting prop left={()=>null}
I'm having the same problem as @g4laura. I want to remove the back button titles but when I add backTitle = " " the back button start showing in every screen even if there wasn't one before adding that property. Is there any solution in which the back button doesn't show when is not suppose to?
@y2k-shubham how could I change it dynamically, I want to disable back button when some progress is on loading, and after progress is done, I show it again?
my workaround for hide/show dynamically is changing navigation setParams property which related to the react-navigation is:
useEffect(() => {
props.navigation.setParams({
left:
state.sync.isSending || state.uploadPhotos.isUploading ? null : (
<RenderBackButton />
),
});
}, [state.sync.isSending, state.uploadPhotos.isUploading]);
RenderBackButton component:
export const RenderBackButton = () => (
<TouchableOpacity onPress={() => Actions.pop()}>
<View style={styles.backButtonWrapper}>
<Icon type="Ionicons" name="ios-arrow-back" style={styles.icon} />
<Text style={styles.text}>Lista Impianti</Text>
</View>
</TouchableOpacity>
);
Most helpful comment
As told in https://github.com/aksonov/react-native-router-flux/issues/2219, passing the
propbackTitle = " "(_space in quotes_; NOT empty string) does the job