andria-dev / react-spring-modal

Animatable and accessible modals built with react-spring
34 stars 8 forks source link

globalThis? #1

Closed micahbrich closed 5 years ago

micahbrich commented 5 years ago

Hey! This looks like a library for exactly what I wanted to build — but I'm a little hung up on globalThis. A tiny bit of research says it's a new proposal for replacing the global object (I think?), but do you have any tips on how to get this working out the gate? I can't seem to get past globalThis is not defined errors!

andria-dev commented 5 years ago

@micahbrich You need to use a globalThis polyfill for environments that don't have support for globalThis (i.e. Node versions below 12 and older browser versions)

My favorite globalThis polyfill is @ungap/global-this

andria-dev commented 5 years ago

I've updated the README with a Frequently Asked Questions (FAQ) section that includes this information for future users that encounter this error

skychavda commented 3 years ago

@andria-dev How would I use your suggested package in my next js project.

Here is my tech stack "next": "^10.1.3", "react": "^17.0.2", "react-dom": "^17.0.2",

Please suggest me some solution ASAP

andria-dev commented 3 years ago

@skychavda Please check out the Next.js example in the repo. If you can't figure it out from there, please create a new issue detailing the exact problems you are encountering so that those issues can be resolved.

https://github.com/andria-dev/react-spring-modal/tree/main/examples%2Fnextjs