ChainId is NaN (cannot convert to string) error and React rendering twice issue #102
-
Everytime I execute my code for the LotteryEntrance.js file when deploying my front end of the lottery smart contract, I keep getting the error:
I initially thought that this was due to the fact that I didn't have the Rinkeby chainId "4" in my contractAddresses.json (since I was just on the local network) but I have since hardcoded my address and the "4" and I am still getting the error. Also of note is that when the ReactDOM initially renders my application, it quickly prints |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
@Valodax yes, this is an async issue. Usually, to get around this, I do something like: if (chainId) {
// do whatever
} or something. Is this what my code base is showing too? |
Beta Was this translation helpful? Give feedback.
@Valodax yes, this is an async issue.
Usually, to get around this, I do something like:
or something. Is this what my code base is showing too?