use setParams instead of replace
This commit is contained in:
@@ -538,7 +538,7 @@ export function SearchScreen(
|
|||||||
setSearchText(queryParam)
|
setSearchText(queryParam)
|
||||||
} else {
|
} else {
|
||||||
// The empty object will remove `q=` from the URL
|
// The empty object will remove `q=` from the URL
|
||||||
navigation.replace('Search', {})
|
navigation.setParams({})
|
||||||
}
|
}
|
||||||
}, [inputIsFocused, navigation, queryParam])
|
}, [inputIsFocused, navigation, queryParam])
|
||||||
|
|
||||||
@@ -572,14 +572,14 @@ export function SearchScreen(
|
|||||||
)
|
)
|
||||||
|
|
||||||
const onSubmit = React.useCallback(() => {
|
const onSubmit = React.useCallback(() => {
|
||||||
textInput.current?.blur()
|
|
||||||
setInputIsFocused(false)
|
|
||||||
scrollToTopWeb()
|
scrollToTopWeb()
|
||||||
updateSearchHistory(searchText)
|
updateSearchHistory(searchText)
|
||||||
|
|
||||||
if (isWeb) {
|
if (isWeb) {
|
||||||
navigation.push('Search', {q: searchText})
|
navigation.push('Search', {q: searchText})
|
||||||
} else {
|
} else {
|
||||||
|
textInput.current?.blur()
|
||||||
|
setInputIsFocused(false)
|
||||||
navigation.setParams({q: searchText})
|
navigation.setParams({q: searchText})
|
||||||
}
|
}
|
||||||
}, [navigation, searchText, updateSearchHistory])
|
}, [navigation, searchText, updateSearchHistory])
|
||||||
|
|||||||
Reference in New Issue
Block a user