remove unnecessary useCallback in Widgets component

This commit is contained in:
Evan Simkowitz 2024-06-17 14:23:57 -07:00
parent bd93504314
commit 9adecebbf2
No known key found for this signature in database

View File

@ -15,7 +15,7 @@ import {
getLayoutStateAtomForTab,
useLayoutTreeStateReducerAtom,
} from "@/faraday/lib/layoutAtom";
import { useCallback, useMemo } from "react";
import { useMemo } from "react";
import "./workspace.less";
function Tab({ tabId }: { tabId: string }) {
@ -71,16 +71,13 @@ function Widgets() {
}, [windowData.activetabid]);
const [, dispatchLayoutStateAction] = useLayoutTreeStateReducerAtom(activeTabAtom);
const addBlockToTab = useCallback(
(blockId: string) => {
function addBlockToTab(blockId: string) {
const insertNodeAction: LayoutTreeInsertNodeAction<TabLayoutData> = {
type: LayoutTreeActionType.InsertNode,
node: newLayoutNode<TabLayoutData>(undefined, undefined, undefined, { blockId }),
};
dispatchLayoutStateAction(insertNodeAction);
},
[activeTabAtom, dispatchLayoutStateAction]
);
}
async function createBlock(blockDef: BlockDef) {
const rtOpts: RuntimeOpts = { termsize: { rows: 25, cols: 80 } };