fix: more eye-droper fixes (#7019)

This commit is contained in:
David Luzar
2023-09-21 06:24:03 +02:00
committed by GitHub
parent 741d5f1a18
commit f8b3692262
6 changed files with 115 additions and 59 deletions

7
src/hooks/useStable.ts Normal file
View 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;
};