wagmi 1.3.4 → 1.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -41,7 +41,7 @@ type UseAccountConfig = {
41
41
  /** Function to invoke when disconnected */
42
42
  onDisconnect?(): void;
43
43
  };
44
- declare function useAccount({ onConnect, onDisconnect }?: UseAccountConfig): GetAccountResult<_wagmi_core.PublicClient>;
44
+ declare function useAccount({ onConnect, onDisconnect }?: UseAccountConfig): GetAccountResult<PublicClient>;
45
45
 
46
46
  type UseInfiniteQueryResult<TData, TError> = Pick<InfiniteQueryObserverResult<TData, TError>, 'data' | 'error' | 'fetchNextPage' | 'fetchStatus' | 'hasNextPage' | 'isError' | 'isFetched' | 'isFetchedAfterMount' | 'isFetching' | 'isFetchingNextPage' | 'isLoading' | 'isRefetching' | 'isSuccess' | 'refetch'> & {
47
47
  isIdle: boolean;
package/dist/index.js CHANGED
@@ -622,7 +622,12 @@ function useSyncExternalStoreWithTracked(subscribe, getSnapshot, getServerSnapsh
622
622
 
623
623
  // src/hooks/accounts/useAccount.ts
624
624
  function useAccount({ onConnect, onDisconnect } = {}) {
625
- const account = useSyncExternalStoreWithTracked(watchAccount, getAccount);
625
+ const config = useConfig();
626
+ const watchAccount_ = React9.useCallback(
627
+ (callback) => watchAccount(callback),
628
+ [config]
629
+ );
630
+ const account = useSyncExternalStoreWithTracked(watchAccount_, getAccount);
626
631
  const previousAccountRef = React9.useRef();
627
632
  const previousAccount = previousAccountRef.current;
628
633
  React9.useEffect(() => {
@@ -831,8 +836,14 @@ function useDisconnect({
831
836
 
832
837
  // src/hooks/accounts/useNetwork.ts
833
838
  import { getNetwork, watchNetwork } from "@wagmi/core";
839
+ import { useCallback as useCallback5 } from "react";
834
840
  function useNetwork() {
835
- return useSyncExternalStoreWithTracked(watchNetwork, getNetwork);
841
+ const config = useConfig();
842
+ const watchNetwork_ = useCallback5(
843
+ (callback) => watchNetwork(callback),
844
+ [config]
845
+ );
846
+ return useSyncExternalStoreWithTracked(watchNetwork_, getNetwork);
836
847
  }
837
848
 
838
849
  // src/hooks/accounts/useSignMessage.ts
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "wagmi",
3
3
  "description": "React Hooks for Ethereum",
4
4
  "license": "MIT",
5
- "version": "1.3.4",
5
+ "version": "1.3.5",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/wagmi-dev/wagmi.git",