2/n reduce react re-renders

This commit is contained in:
Igor Katson 2023-12-19 23:05:57 +00:00
parent e6ef3ff23f
commit 89bbcd2a27
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5
7 changed files with 66 additions and 25 deletions

View file

@ -8,7 +8,9 @@ export const RootContent = (props: {}) => {
let setCloseableError = useErrorStore((state) => state.setCloseableError);
let otherError = useErrorStore((state) => state.otherError);
let torrents = useTorrentStore((state) => state.torrents);
let torrentsLoading = useTorrentStore((state) => state.torrentsLoading);
let torrentsInitiallyLoading = useTorrentStore(
(state) => state.torrentsInitiallyLoading
);
return (
<div className="container mx-auto">
@ -17,7 +19,7 @@ export const RootContent = (props: {}) => {
remove={() => setCloseableError(null)}
/>
<ErrorComponent error={otherError} />
<TorrentsList torrents={torrents} loading={torrentsLoading} />
<TorrentsList torrents={torrents} loading={torrentsInitiallyLoading} />
</div>
);
};