diff --git a/package.json b/package.json index f01119c..948f402 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "replicache-react", - "version": "4.0.0", + "version": "4.0.1", "description": "Miscellaneous utilities for using Replicache with React", "homepage": "https://replicache.dev", "repository": "github:rocicorp/replicache-react", diff --git a/src/index.ts b/src/index.ts index 7d14138..25a890f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -55,7 +55,13 @@ export function useSubscribe( unsubscribe(); setSnapshot(undefined); }; - }, [r, def, ...deps]); + // NOTE: `def` and `query` not passed as a dep here purposely. It would be + // more correct to pass them, but it's also a footgun since it's common to + // pass object, array, or function literals which change on every render. + // Also note that if this ever changes, it's a breaking change and should + // be documented, as if callers pass an object/array/func literal, changing + // this will cause a render loop that would be hard to debug. + }, [r, ...deps]); if (snapshot === undefined) { return def; }