mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-04-14 16:40:58 -04:00
7 lines
199 B
TypeScript
7 lines
199 B
TypeScript
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;
|
|
};
|