Skip to content

Commit bd523b4

Browse files
committed
Simplify
1 parent 48fd313 commit bd523b4

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/component/src/providers/ClipboardWritePermissionWithStable/private/useStableStateHook.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,10 @@ export default function useStableStateHook<T>(
1515
value: T,
1616
setValue?: Dispatch<SetStateAction<T>> | undefined
1717
): () => readonly [T, Dispatch<SetStateAction<T>>] | readonly [T] {
18-
const propagationRef = useRefWithInit<ReturnType<typeof createPropagation<T>>>(() => createPropagation<T>());
19-
const valueRef = useRefFrom(value);
20-
2118
const {
2219
current: { usePropagate, useListen }
23-
} = propagationRef;
20+
} = useRefWithInit<ReturnType<typeof createPropagation<T>>>(() => createPropagation<T>());
21+
const valueRef = useRefFrom(value);
2422

2523
const propagate = usePropagate();
2624

0 commit comments

Comments
 (0)