mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-03 00:47:53 +00:00
Fix Sidepanel setState Race Condition (#436)
SidePanel has many children Panels that is trying to setState while the SidePanel holder itself is trying to set state, creating a setState race. problem is fixed by eliminating a unnecessary setState. Co-authored-by: wil <wil@storyteller.ai>
This commit is contained in:
1 parent
846dd8be82
commit
a4e8e68b8b
1 file changed
+2
-9
@@ -1,20 +1,13 @@
|
||||
import { useSignals } from "@preact/signals-react/runtime";
|
||||
import { selectedTab, sidePanelHeight } from "~/pages/PageEnigma/signals";
|
||||
import {
|
||||
TabItem,
|
||||
tabList,
|
||||
} from "~/pages/PageEnigma/comps/SidePanelTabs/tabList";
|
||||
import { tabList } from "~/pages/PageEnigma/comps/SidePanelTabs/tabList";
|
||||
import { useMouseEventsSidePanel } from "~/pages/PageEnigma/comps/Timeline/utils/useMouseEventsSidePanel";
|
||||
import { useLayoutEffect, useState } from "react";
|
||||
import { environmentVariables } from "~/signals";
|
||||
|
||||
export const SidePanelTabs = () => {
|
||||
useSignals();
|
||||
const { onPointerDown } = useMouseEventsSidePanel();
|
||||
const [tabs, setTabs] = useState<TabItem[]>();
|
||||
useLayoutEffect(() => {
|
||||
setTabs(tabList(environmentVariables.value));
|
||||
}, []);
|
||||
const tabs = tabList(environmentVariables.value);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
Reference in new issue
Block a user