Skip to content

Commit

Permalink
feat(fscomponents): Replace all occurrences of "any" in SearchScreen
Browse files Browse the repository at this point in the history
  • Loading branch information
olkorsia committed May 6, 2020
1 parent 59473f5 commit 53a9b2f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/fscomponents/src/components/SearchScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export interface SearchScreenState {
}

export class SearchScreen extends PureComponent<SearchScreenProps, SearchScreenState> {
searchBar: any;
searchBar: SearchBar | null = null;

constructor(props: SearchScreenProps) {
super(props);
Expand All @@ -88,14 +88,14 @@ export class SearchScreen extends PureComponent<SearchScreenProps, SearchScreenS
const { searchBarShouldFocus } = this.props;

// Focus on the search bar by default
if (searchBarShouldFocus === undefined || searchBarShouldFocus) {
if (this.searchBar !== null && (searchBarShouldFocus === undefined || searchBarShouldFocus)) {
this.searchBar.focusInput();
}

this.loadHistoryToState();
}

getSearchBarRef = (ref: any) => {
getSearchBarRef = (ref: SearchBar) => {
this.searchBar = ref;
}

Expand Down Expand Up @@ -233,7 +233,7 @@ export class SearchScreen extends PureComponent<SearchScreenProps, SearchScreenS

return (
<Text style={[S.suggestionTitle, this.props.itemTextStyle]}>
{strArr.map((str: any, i: number) => {
{strArr.map((str: HighlightResult, i: number) => {
return (
<Text key={i} style={str.isHighlight && S.suggestionHighlight}>
{str.str}
Expand Down Expand Up @@ -288,7 +288,7 @@ export class SearchScreen extends PureComponent<SearchScreenProps, SearchScreenS
}
}

function highlightStr(name: string, query: string): any {
function highlightStr(name: string, query: string): HighlightResult[] {
let queryRegx;

try {
Expand Down

0 comments on commit 53a9b2f

Please sign in to comment.