Comments (2)
Hi all, thanks @matthewkeil for raising this issue, and for starting a PR #19 to fix it! I came across it too.
As a temporary workaround until the fix is released, one can wrap the specific components using useMetamask
with a no-SSR wrapper.
<NoSsr>
<ComponentLeveragingUseMetamask />
</NoSsr>
Here's Material-UI's implementation: https://github.com/mui-org/material-ui/blob/v5.2.6/packages/mui-base/src/NoSsr/NoSsr.js - Since I'm not using Material-UI for my project, I made a simpler component:
const NoSsr = ({ children }: { children: React.ReactNode }) => {
const [mountedState, setMountedState] = useState(false);
useEffect(() => {
setMountedState(true);
}, []);
return <>{mountedState ? children : null}</>;
};
Hope this helps until the fix is released!
Also, @mdtanrikulu, thanks for creating use-metamask
! It's so convenient!
from use-metamask.
Thank you so much for you kind words! I was away maintaining this package, but back and updating things as much as I can. The relevant package is merged, gonna publish new version with it.
from use-metamask.
Related Issues (19)
- Does this work with react native? HOT 1
- Any metaState change leads to component re-rendering 4 times.
- TypeScript type declarations HOT 2
- Would it be possible to build a version without Context and simply useState instead? HOT 4
- Introduce Metamask in Demo screen if user doesn't have extension installed
- getChain returns Netword Id rather than Chain Id
- Didn't work with Webpack5 HOT 2
- Compatibility with Alchemy Web3, a wrapper around Web3.js
- Chain change
- TypeError: #<Object> is not a constructor HOT 2
- Missing dependency when build with vite HOT 1
- 'Component is not mounted' error when calling connect() from an onClick handler HOT 2
- NextJS Error Cannot read properties of null (reading 'useReducer')
- window is not defined when using Next.js HOT 1
- Metamask + Coinbase Wallet Extension not working HOT 2
- Add event handler for any sort of transaction HOT 1
- Integration with NextJS HOT 11
- update isConnected silently HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from use-metamask.