react-ladda
react-ladda copied to clipboard
Breaks server side rendering
We run a react app that uses server side rendering.
When we import react-ladda, we get the following error message. The error goes away when we comment out the line that imports react-ladda.
ERROR in SERVER PRERENDERING
Encountered error: "ReferenceError: document is not defined"
We have traced the issue back to the ladda package (required by react-ladda). The below file accesses the document directly, but the document is not defined in node.js (I would open an issue in Ladda directly, but it looks like issues have been disabled in that package.)
https://github.com/hakimel/Ladda/blob/e5fa9e7681334a47419a126bdcb6aaefd05424da/js/ladda.js
Has anyone else encountered this issue before and what approach do you recommend?