Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.

fix: re-render while autoload#92

Merged
PaulRBerg merged 2 commits intoWalletConnect:stagingfrom
gasolin:autoload
Dec 20, 2020
Merged

fix: re-render while autoload#92
PaulRBerg merged 2 commits intoWalletConnect:stagingfrom
gasolin:autoload

Conversation

@gasolin
Copy link
Copy Markdown
Contributor

@gasolin gasolin commented Nov 9, 2020

fix the rerender issue while autoload === true

@PaulRBerg
Copy link
Copy Markdown
Contributor

PaulRBerg commented Nov 11, 2020

Hi @gasolin, thanks for your contribution.

Could you add more details to the problem targeted by this change? When does the UI re-render? A GIF may be helpful.

@gasolin
Copy link
Copy Markdown
Contributor Author

gasolin commented Nov 11, 2020

@PaulRBerg sorry for the inconvinient.

During test project development I found when autoload set to true(the default case),
the related effect turns to an infinite loop (can monitor by add console.log in that useEffect)

It might be related to the web3Modal.cachedProvider keep changing

@PaulRBerg
Copy link
Copy Markdown
Contributor

I understand, but I can't reproduce this. Could you maybe upload a GIF that shows how the re-render occurs on your computer?

@gasolin
Copy link
Copy Markdown
Contributor Author

gasolin commented Nov 12, 2020

UI doesn't change, but your CPU/FAN will roar when you open the page longer

@PaulRBerg
Copy link
Copy Markdown
Contributor

My CPU doesn't roar, but I have a high-end spec so maybe that's the reason.

@TomAFrench can you reproduce this?

Sorry to be a pain in the neck @gasolin, but I would not introduce more complexity in the template if the change is a no-op.

@Neozaru
Copy link
Copy Markdown

Neozaru commented Dec 1, 2020

Could definitely reproduce this as this caused me exceed my Metamask's Infura quota :D

Env :

  • Windows 10
  • Google Chrome
  • Metamask (Kovan with default params)

Steps to reproduce :

  • Add the line console.log('ETH2 launch successful') somewhere in the base component (ex: App() function).
  • Open dApp with dev tools open, and check console.

@gasolin Thanks. That solved the issue for me.

Come back to me for questions / if you can't reproduce.

@PaulRBerg
Copy link
Copy Markdown
Contributor

Whoah, you are right. Just added the console log as you suggested @Neozaru and this is what I'm seeing:

Enregistrement.de.l.ecran.2020-12-20.a.14.17.04.mov

Crazy. Looking at @gasolin's fix now.

@PaulRBerg PaulRBerg merged commit 4be9046 into WalletConnect:staging Dec 20, 2020
pbbhopp pushed a commit to veloxoft/space-swap-front that referenced this pull request Mar 29, 2021
fabioDMFerreira pushed a commit to fabioDMFerreira/create-eth-app that referenced this pull request Aug 12, 2021
* fix: re-render while autoload

* feat: update comment in useWeb3Modal.js

Co-authored-by: Paul Razvan Berg <hello@paulrberg.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants