Shared:Selectors: fix infinity use effect
This commit is contained in:
parent
5b86d792ac
commit
4fd042b998
@ -72,7 +72,7 @@ const PeopleSelector = ({
|
||||
|
||||
const [itemsList, setItemsList] = useState(items);
|
||||
const [searchValue, setSearchValue] = useState("");
|
||||
const [total, setTotal] = useState(0);
|
||||
const [total, setTotal] = useState<number>(-1);
|
||||
const [hasNextPage, setHasNextPage] = useState(true);
|
||||
const [isNextPageLoading, setIsNextPageLoading] = useState(false);
|
||||
const [isLoading, setIsLoading] = useLoadingWithTimeout<boolean>(
|
||||
@ -222,7 +222,8 @@ const PeopleSelector = ({
|
||||
|
||||
useEffect(() => {
|
||||
loadNextPage(0);
|
||||
}, [loadNextPage]);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
const emptyScreenImage = theme.isBase
|
||||
? EmptyScreenPersonsSvgUrl
|
||||
|
@ -64,7 +64,7 @@ const RoomSelector = ({
|
||||
const [hasNextPage, setHasNextPage] = React.useState(false);
|
||||
const [isNextPageLoading, setIsNextPageLoading] = React.useState(false);
|
||||
|
||||
const [total, setTotal] = React.useState(0);
|
||||
const [total, setTotal] = React.useState(-1);
|
||||
|
||||
const [items, setItems] = React.useState<TSelectorItem[]>([]);
|
||||
|
||||
@ -134,7 +134,7 @@ const RoomSelector = ({
|
||||
|
||||
React.useEffect(() => {
|
||||
onLoadNextPage(0);
|
||||
}, [onLoadNextPage, searchValue]);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<Selector
|
||||
|
Loading…
Reference in New Issue
Block a user