fix state initialization, add proptype
This commit is contained in:
1 parent
59adc526fe
commit
21385864fc
2 files changed
+3
-2
No files matched your search
@@ -167,7 +167,7 @@ const MonitorTable = ({ isAdmin, filter, setLoading }) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
fetchPage();
|
fetchPage();
|
||||||
}, [updateTrigger, authState, page, rowsPerPage, filter, sort]);
|
}, [updateTrigger, authState, page, rowsPerPage, filter, sort, setLoading]);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper function to calculate the range of displayed rows.
|
* Helper function to calculate the range of displayed rows.
|
||||||
@@ -408,6 +408,7 @@ const MonitorTable = ({ isAdmin, filter, setLoading }) => {
|
|||||||
MonitorTable.propTypes = {
|
MonitorTable.propTypes = {
|
||||||
isAdmin: PropTypes.bool,
|
isAdmin: PropTypes.bool,
|
||||||
filter: PropTypes.string,
|
filter: PropTypes.string,
|
||||||
|
setLoading: PropTypes.func,
|
||||||
};
|
};
|
||||||
|
|
||||||
const MemoizedMonitorTable = memo(MonitorTable);
|
const MemoizedMonitorTable = memo(MonitorTable);
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ const Monitors = ({ isAdmin }) => {
|
|||||||
const monitorState = useSelector((state) => state.uptimeMonitors);
|
const monitorState = useSelector((state) => state.uptimeMonitors);
|
||||||
const authState = useSelector((state) => state.auth);
|
const authState = useSelector((state) => state.auth);
|
||||||
const [search, setSearch] = useState("");
|
const [search, setSearch] = useState("");
|
||||||
const [isSearching, setIsSearching] = useState("");
|
const [isSearching, setIsSearching] = useState(false);
|
||||||
const dispatch = useDispatch({});
|
const dispatch = useDispatch({});
|
||||||
const debouncedFilter = useDebounce(search, 500);
|
const debouncedFilter = useDebounce(search, 500);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user