coopermaruyama/react-web3

Chrome problems with Metamask

Closed this issue · 1 comments

Hi,

Thanks for this!

My question is maybe a bit off-topic, sorry if it is. I'm using a window.addEventListener callback in componentDidMount() to load data from the BC. With Chrome and Metamask, most of the time data won't load. When I turn on Developer tools with caching disabled, everything is fine. I don't have such problems with Firefox. The App was created with create-react-app.

Does someone have any clue ? I was thinking it could be related to https://stackoverflow.com/questions/44436179/better-pattern-to-detect-web3-default-account-when-using-metamask and that maybe a timeout could help, but I did not try yet.

I just realized I don't have to add window.addEventListener. componentDidMount() is more than enough! Solves the problem I had with Chrome.