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
|
||||
useImperativeHandle(ref, () => ({
|
||||
const imperativeHandleMethods = useMemo(() => {
|
||||
return () => ({
|
||||
setSplitSizes,
|
||||
animateWidth
|
||||
}));
|
||||
});
|
||||
}, [setSplitSizes, animateWidth]);
|
||||
|
||||
// Add useImperativeHandle to expose the function
|
||||
useImperativeHandle(ref, imperativeHandleMethods);
|
||||
|
||||
return (
|
||||
<div className="h-full w-full">
|
||||
|
|
Loading…
Reference in New Issue