mirror of https://github.com/buster-so/buster.git
memoize impertative function
This commit is contained in:
parent
16866accbb
commit
c91647198d
|
@ -178,11 +178,15 @@ export const AppSplitter = forwardRef<
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
// Add useImperativeHandle to expose the function
|
const imperativeHandleMethods = useMemo(() => {
|
||||||
useImperativeHandle(ref, () => ({
|
return () => ({
|
||||||
setSplitSizes,
|
setSplitSizes,
|
||||||
animateWidth
|
animateWidth
|
||||||
}));
|
});
|
||||||
|
}, [setSplitSizes, animateWidth]);
|
||||||
|
|
||||||
|
// Add useImperativeHandle to expose the function
|
||||||
|
useImperativeHandle(ref, imperativeHandleMethods);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="h-full w-full">
|
<div className="h-full w-full">
|
||||||
|
|
Loading…
Reference in New Issue