Skip to content
This repository has been archived by the owner on Dec 3, 2024. It is now read-only.

navigation.goBack(null) and fix SearchBar cancelButtonText #7

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import {
StyleSheet,
View,
} from 'react-native';
import { withNavigation, HeaderBackButton } from 'react-navigation';
import { withNavigation } from 'react-navigation';
import { HeaderBackButton } from 'react-navigation-stack';
import { getInset, getStatusBarHeight } from 'react-native-safe-area-view';
import { isIphoneX } from 'react-native-iphone-x-helper';

Expand Down
2 changes: 1 addition & 1 deletion src/SearchBar.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export default class SearchBar extends React.PureComponent {
if (this.props.onCancelPress) {
this.props.onCancelPress(this.props.navigation.goBack);
} else {
this.props.navigation.goBack();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think we should probably just let the user override it with onCancelPress rather than default to goBack(null) here

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reverted goBack(null) to goBack().

this.props.navigation.goBack(null);
}
};
}
Expand Down
1 change: 1 addition & 0 deletions src/SearchLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export default class SearchLayout extends React.Component {
tintColor={
this.props.searchInputTintColor || this.props.headerTintColor
}
cancelButtonText={this.props.cancelButtonText}
/>
</Header>

Expand Down