Skip to content

Commit 0676e04

Browse files
Fix: Next.js build (#314)
* Fix: Next.js build * add changeset Co-authored-by: Dhaiwat Pandya <[email protected]>
1 parent 3231b24 commit 0676e04

File tree

5 files changed

+13
-4
lines changed

5 files changed

+13
-4
lines changed

.changeset/spicy-zoos-drive.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@web3-ui/components': patch
3+
'@web3-ui/core': patch
4+
'@web3-ui/hooks': patch
5+
---
6+
7+
Fix some types/imports so that the packages work well with Next.js & ts

packages/components/src/components/AddressInput/AddressInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
import React, { useEffect, useState } from 'react';
99
import { ethers } from 'ethers';
1010
import { useDebounce } from './useDebounce';
11-
import { JsonRpcSigner } from '@ethersproject/providers/src.ts/json-rpc-provider';
11+
import { JsonRpcSigner } from '@ethersproject/providers';
1212

1313
export interface AddressInputProps {
1414
/**

packages/hooks/src/Provider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { JsonRpcSigner } from '@ethersproject/providers/src.ts/json-rpc-provider';
1+
import { JsonRpcSigner } from '@ethersproject/providers';
22
import WalletConnectProvider from '@walletconnect/web3-provider';
33
import { ethers } from 'ethers';
44
import React, { createContext, useCallback, useMemo, useState } from 'react';

packages/hooks/src/hooks/useTransaction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import React from 'react';
1515
*/
1616

1717
export function useTransaction(
18-
method
18+
method: any
1919
): [(args: any) => Promise<any>, boolean, any] {
2020
const [loading, setLoading] = React.useState<boolean>(false);
2121
const [error, setError] = React.useState<any>(null);

packages/hooks/src/hooks/useWallet.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ export function useWallet() {
6868
error,
6969
connection: {
7070
userAddress,
71-
network: CHAIN_ID_TO_NETWORK[chainId as number],
71+
network: (CHAIN_ID_TO_NETWORK as { [key: number]: string })[
72+
chainId as number
73+
],
7274
signer,
7375
ens,
7476
},

0 commit comments

Comments
 (0)