mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix: more eye-droper fixes (#7019)
This commit is contained in:
parent
741d5f1a18
commit
f8b3692262
6 changed files with 115 additions and 59 deletions
7
src/hooks/useStable.ts
Normal file
7
src/hooks/useStable.ts
Normal file
|
@ -0,0 +1,7 @@
|
|||
import { useRef } from "react";
|
||||
|
||||
export const useStable = <T extends Record<string, any>>(value: T) => {
|
||||
const ref = useRef<T>(value);
|
||||
Object.assign(ref.current, value);
|
||||
return ref.current;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue