diff --git a/src/index.ts b/src/index.ts index 0718b8f..68a899d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -31,8 +31,8 @@ export function useZustand( () => [slice, store], ); useEffect(() => { - const unsubscribe = store.subscribe(rerender as DispatchWithoutAction); - (rerender as DispatchWithoutAction)(); + const unsubscribe = store.subscribe(() => rerender()); + rerender(); return unsubscribe; }, [store]); if (storeFromReducer !== store) {