You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now, looking up the pages/index.tsx file of the react-dapp-v2-with-ethers example, one finds a component with 300+ lines of code.
Lots of logic packed in the component, which makes reading/understanding harder specially if on your first contact with Wallet Connect.
My suggestion would be to try an keep main components minimal. Extract away anything that is not core responsibility of the component. It'll be much much easier to grasp what the core logic is.
In our company we try to keep a cap of ~100 lines max to any React or Node.js file.
It helps a lot to think through stuff (and test it).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Firstly, super thanks for the amazing lib!!!
Now, looking up the pages/index.tsx file of the
react-dapp-v2-with-ethers
example, one finds a component with 300+ lines of code.Lots of logic packed in the component, which makes reading/understanding harder specially if on your first contact with Wallet Connect.
My suggestion would be to try an keep main components minimal. Extract away anything that is not core responsibility of the component. It'll be much much easier to grasp what the core logic is.
In our company we try to keep a cap of ~100 lines max to any React or Node.js file.
It helps a lot to think through stuff (and test it).
Many thanks for the open source code again 🙏
Beta Was this translation helpful? Give feedback.
All reactions