diff --git a/packages/core/package.json b/packages/core/package.json index 3ca8a7b..d0dd032 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -25,7 +25,7 @@ "dependencies": { "@web3-react/store": "^8.0.17-beta.0", "@web3-react/types": "^8.0.12-beta.0", - "zustand": "^4.0.0-beta.3" + "zustand": "^4.0.0-rc.0" }, "peerDependencies": { "react": ">=16.8" diff --git a/packages/core/src/hooks.ts b/packages/core/src/hooks.ts index c96d3c5..410d8f2 100644 --- a/packages/core/src/hooks.ts +++ b/packages/core/src/hooks.ts @@ -32,7 +32,7 @@ export function initializeConnector( const [store, actions] = createWeb3ReactStoreAndActions(allowedChainIds) const connector = f(actions) - const useConnector = create(store) + const useConnector = create(store) const stateHooks = getStateHooks(useConnector) const derivedHooks = getDerivedHooks(stateHooks) @@ -246,7 +246,7 @@ const ACCOUNTS_EQUALITY_CHECKER: EqualityChecker = ( const ACTIVATING = (state: Web3ReactState) => state.activating const ERROR = (state: Web3ReactState) => state.error -function getStateHooks(useConnector: UseBoundStore) { +function getStateHooks(useConnector: UseBoundStore) { function useChainId(): Web3ReactState['chainId'] { return useConnector(CHAIN_ID) } diff --git a/packages/core/yarn.lock b/packages/core/yarn.lock index a2d0018..03507e4 100644 --- a/packages/core/yarn.lock +++ b/packages/core/yarn.lock @@ -288,9 +288,9 @@ ws@7.4.6: resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c" integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A== -zustand@^4.0.0-beta.3: - version "4.0.0-beta.3" - resolved "https://registry.yarnpkg.com/zustand/-/zustand-4.0.0-beta.3.tgz#16dc82b48b65ed61fe2bae5dea4501f49bd450c7" - integrity sha512-cVDcspaK0CXgVmGcXB/oenhT7EFaKqD46pTmg30ciMsOoQN0ZuxEuHzpNIy9ejah0gzBL8aqHN89IMT2uFNOaA== +zustand@^4.0.0-rc.0: + version "4.0.0-rc.0" + resolved "https://registry.yarnpkg.com/zustand/-/zustand-4.0.0-rc.0.tgz#644982d70ea1eba3b6983790608bfe101afdd649" + integrity sha512-jMimx6EIlLb/hwgnkVZ4Wd/UI73wXedUB6L/kcdIYbOYHcjIFRc7JEB8IXFZt+1rQq2qwuts7kN6kuHhFss47A== dependencies: use-sync-external-store "1.0.0" diff --git a/packages/store/package.json b/packages/store/package.json index 57f8093..c163c88 100644 --- a/packages/store/package.json +++ b/packages/store/package.json @@ -25,6 +25,6 @@ "dependencies": { "@ethersproject/address": "^5", "@web3-react/types": "^8.0.12-beta.0", - "zustand": "^4.0.0-beta.3" + "zustand": "^4.0.0-rc.0" } } diff --git a/packages/store/src/index.ts b/packages/store/src/index.ts index 8b40ac0..f34ae9d 100644 --- a/packages/store/src/index.ts +++ b/packages/store/src/index.ts @@ -1,6 +1,6 @@ import { getAddress } from '@ethersproject/address' import type { Actions, Web3ReactState, Web3ReactStateUpdate, Web3ReactStore } from '@web3-react/types' -import create from 'zustand/vanilla' +import { createStore } from 'zustand' /** * MAX_SAFE_CHAIN_ID is the upper bound limit on what will be accepted for `chainId` @@ -49,7 +49,7 @@ export function createWeb3ReactStoreAndActions(allowedChainIds?: number[]): [Web throw new Error(`allowedChainIds is length 0`) } - const store = create(() => DEFAULT_STATE) + const store = createStore()(() => DEFAULT_STATE) // flag for tracking updates so we don't clobber data when cancelling activation let nullifier = 0 diff --git a/packages/store/yarn.lock b/packages/store/yarn.lock index ac622ad..3e3b723 100644 --- a/packages/store/yarn.lock +++ b/packages/store/yarn.lock @@ -65,9 +65,9 @@ use-sync-external-store@1.0.0: resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.0.0.tgz#d98f4a9c2e73d0f958e7e2d2c2bfb5f618cbd8fd" integrity sha512-AFVsxg5GkFg8GDcxnl+Z0lMAz9rE8DGJCc28qnBuQF7lac57B5smLcT37aXpXIIPz75rW4g3eXHPjhHwdGskOw== -zustand@^4.0.0-beta.3: - version "4.0.0-beta.3" - resolved "https://registry.yarnpkg.com/zustand/-/zustand-4.0.0-beta.3.tgz#16dc82b48b65ed61fe2bae5dea4501f49bd450c7" - integrity sha512-cVDcspaK0CXgVmGcXB/oenhT7EFaKqD46pTmg30ciMsOoQN0ZuxEuHzpNIy9ejah0gzBL8aqHN89IMT2uFNOaA== +zustand@^4.0.0-rc.0: + version "4.0.0-rc.0" + resolved "https://registry.yarnpkg.com/zustand/-/zustand-4.0.0-rc.0.tgz#644982d70ea1eba3b6983790608bfe101afdd649" + integrity sha512-jMimx6EIlLb/hwgnkVZ4Wd/UI73wXedUB6L/kcdIYbOYHcjIFRc7JEB8IXFZt+1rQq2qwuts7kN6kuHhFss47A== dependencies: use-sync-external-store "1.0.0" diff --git a/packages/types/package.json b/packages/types/package.json index 4480272..d2db818 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -23,6 +23,6 @@ "start": "tsc --watch" }, "dependencies": { - "zustand": "^4.0.0-beta.3" + "zustand": "^4.0.0-rc.0" } } diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index 36b94eb..a6ba440 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -1,5 +1,5 @@ import type { EventEmitter } from 'node:events' -import type { State, StoreApi } from 'zustand/vanilla' +import type { State, StoreApi } from 'zustand' export interface Web3ReactState extends State { chainId: number | undefined diff --git a/packages/types/yarn.lock b/packages/types/yarn.lock index d7e268b..24150f9 100644 --- a/packages/types/yarn.lock +++ b/packages/types/yarn.lock @@ -7,9 +7,9 @@ use-sync-external-store@1.0.0: resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.0.0.tgz#d98f4a9c2e73d0f958e7e2d2c2bfb5f618cbd8fd" integrity sha512-AFVsxg5GkFg8GDcxnl+Z0lMAz9rE8DGJCc28qnBuQF7lac57B5smLcT37aXpXIIPz75rW4g3eXHPjhHwdGskOw== -zustand@^4.0.0-beta.3: - version "4.0.0-beta.3" - resolved "https://registry.yarnpkg.com/zustand/-/zustand-4.0.0-beta.3.tgz#16dc82b48b65ed61fe2bae5dea4501f49bd450c7" - integrity sha512-cVDcspaK0CXgVmGcXB/oenhT7EFaKqD46pTmg30ciMsOoQN0ZuxEuHzpNIy9ejah0gzBL8aqHN89IMT2uFNOaA== +zustand@^4.0.0-rc.0: + version "4.0.0-rc.0" + resolved "https://registry.yarnpkg.com/zustand/-/zustand-4.0.0-rc.0.tgz#644982d70ea1eba3b6983790608bfe101afdd649" + integrity sha512-jMimx6EIlLb/hwgnkVZ4Wd/UI73wXedUB6L/kcdIYbOYHcjIFRc7JEB8IXFZt+1rQq2qwuts7kN6kuHhFss47A== dependencies: use-sync-external-store "1.0.0"