I just started with truffle react box.. and i changed a little bit to :
const tx = await instance.set.sendTransaction(999,{from : accounts[0]});
console.log("tx is on the way : ",tx);
const txReceipt = await getMinnedTxPromise(tx);
console.log("tx minned !",txReceipt);
const response = await instance.get.call({from : accounts[0]});
console.log("the response is : ",response.toNumber());
this.setState({storageValue : response.toNumber()});
i added .sendTransaction() so that i could atleast see the transaction has begun. but when i ran this code, this line
console.log("tx is on the way : ",tx);
it logged after the transaction was minned. when i tried .sendTransaction() from trufle console, it did log the transaction hash right away.. only when i try to run this in browser, it doesnt work as expected..
getMinnedTxPromise
- this is your function, which you did not bother to post here, making it quite hard to refer to your question.sendTransaction
returns a hash, not a transaction. You can use this hash to get the transaction receipt viaweb3.eth.getTransactionReceipt
.