type fixes for React 18
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -198,22 +198,24 @@ export const SearchPage = createPageExtension({
|
||||
<Grid item xs>
|
||||
<SearchPagination />
|
||||
<SearchResults>
|
||||
{({ results }) =>
|
||||
results.map((result, index) => {
|
||||
const { noTrack } = config;
|
||||
const { document, ...rest } = result;
|
||||
const SearchResultListItem =
|
||||
getResultItemComponent(result);
|
||||
return (
|
||||
<SearchResultListItem
|
||||
{...rest}
|
||||
key={index}
|
||||
result={document}
|
||||
noTrack={noTrack}
|
||||
/>
|
||||
);
|
||||
})
|
||||
}
|
||||
{({ results }) => (
|
||||
<>
|
||||
{results.map((result, index) => {
|
||||
const { noTrack } = config;
|
||||
const { document, ...rest } = result;
|
||||
const SearchResultListItem =
|
||||
getResultItemComponent(result);
|
||||
return (
|
||||
<SearchResultListItem
|
||||
{...rest}
|
||||
key={index}
|
||||
result={document}
|
||||
noTrack={noTrack}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
</>
|
||||
)}
|
||||
</SearchResults>
|
||||
<SearchResultPager />
|
||||
</Grid>
|
||||
|
||||
@@ -57,18 +57,11 @@ export const HomePageSearchBar = (props: HomePageSearchBarProps) => {
|
||||
handleSearch({ query: ref.current?.value ?? '' });
|
||||
}, [handleSearch]);
|
||||
|
||||
const handleChange = useCallback(
|
||||
value => {
|
||||
setQuery(value);
|
||||
},
|
||||
[setQuery],
|
||||
);
|
||||
|
||||
return (
|
||||
<SearchBarBase
|
||||
value={query}
|
||||
onSubmit={handleSubmit}
|
||||
onChange={handleChange}
|
||||
onChange={setQuery}
|
||||
inputProps={{ ref }}
|
||||
InputProps={{
|
||||
...props.InputProps,
|
||||
|
||||
Reference in New Issue
Block a user