mirror of
https://github.com/vector-im/element-call.git
synced 2026-03-28 06:50:26 +00:00
Type fixes for react v19 compatibility (#2937)
This commit is contained in:
@@ -23,9 +23,9 @@ export const useReactiveState = <T>(
|
||||
updateFn: (prevState?: T) => T,
|
||||
deps: DependencyList,
|
||||
): [T, Dispatch<SetStateAction<T>>] => {
|
||||
const state = useRef<T>();
|
||||
const state = useRef<T | undefined>(undefined);
|
||||
if (state.current === undefined) state.current = updateFn();
|
||||
const prevDeps = useRef<DependencyList>();
|
||||
const prevDeps = useRef<DependencyList | undefined>(undefined);
|
||||
|
||||
// Since we store the state in a ref, we use this counter to force an update
|
||||
// when someone calls setState
|
||||
|
||||
Reference in New Issue
Block a user