schiehll / react-alert

alerts for React
MIT License
607 stars 99 forks source link

Not compatible with Next.js - render blank page on client side #68

Closed flexlee closed 6 years ago

flexlee commented 6 years ago

Trying to use react-alert with Nextjs. I copied the example to wrap my page with <AlertProvider />. However, if I hit / link on the client side when I'm already on /, it will render a blank page. The same is true if I go to any route I'm already on.

Please clone an example repo https://github.com/flexlee/nextjs-react-alert. And run yarn, yarn start. In the browser, if you click the "home" link, you will see a blank page.

flexlee commented 6 years ago

Nextjs doesn't have a root component. So can't use v3 <AlertProvider />. Have to switch back to react-alert v2.

schiehll commented 6 years ago

@flexlee, I've just tested the new version 3.2.0 cloning your repository and it seems to work!

Can you please confirm that updating to the latest release solves the issue?

schiehll commented 6 years ago

I will close it since it's working for me. If you find the same problem again, please reopen.