EatTheBlocks Forum

Multisig Wallet Front end

I am on mini project code with front end with JS, react and Web3. I am on video 10 and get this message below.
Failed to compile.

./src/App.js
Line 22:7: ‘setWallet’ is not defined no-undef
Line 23:7: ‘setApprovers’ is not defined no-undef
Line 24:7: ‘setQuorum’ is not defined no-undef

import React, { useEffect, useState } from 'react';

import { getWeb3, getWallet } from ‘./utils.js’;
import Header from ‘./Header.js’;

function App() {
const [web3, setWeb3] = useState(undefined);
const [accounts, setAccounts] = useState(undefined);
const [wallet, getWallet] = useState(undefined);
const [approvers, getApprovers] = useState(undefined);
const [quorum, getQuorum] = useState(undefined);

useEffect(() => {
const init = async () => {
const web3 = getWeb3();
const accounts = await web3.eth.getAccounts();
const wallet = await getWallet(web3);
const approvers = await wallet.methods.getApprovers().call();
const quorum = await wallet.methods.quorum().call();
setWeb3(web3);
setAccounts(accounts);
setWallet(wallet);
setApprovers(approvers);
setQuorum(quorum);
};
init();
}, []);

const createTransfer = transfer => {
wallet.methods
.createTransfer(transfer.amount, transfer.to)
.send({from: accounts[0], gas: 1000000});
}

if(
typeof web3 === ‘undefined’
|| typeof accounts === ‘undefined’
|| typeof wallet === ‘undefined’
|| typeof approvers === ‘undefined’
|| typeof quorum === ‘undefined’
) {
return

Loading…
;
}

return (


Multisig Dapp



);
}

export default App;

Replace the get by set next to useState()`:

ex. Replace:

const [approvers, getApprovers] = useState(undefined);

By

const [approvers, settApprovers] = useState(undefined);