fix: multiple automatic changes of index column

This commit is contained in:
Ou 2024-11-04 21:43:31 +08:00
parent 552b75d9d1
commit b2fb996a37

View File

@ -8,5 +8,7 @@ export const Route = createFileRoute("/")({
function IndexComponent() {
const focusSources = useAtomValue(focusSourcesAtom)
return <Column id={focusSources.length ? "focus" : "hottest"} />
// eslint-disable-next-line react-hooks/exhaustive-deps
const id = useMemo(() => focusSources.length ? "focus" : "hottest", [])
return <Column id={id} />
}