Closed gbrlsepulveda closed 7 years ago
Thanks for your comment. Actually I have tried to make it work on SSR, but I stuck on it. 😢 And, Sure, I think it could be a good idea to support SSR.
A quick and dirty solution could be:
const React = require('react');
if (typeof window !== 'undefined'){
const ReactSmartbanner = require('react-smartbanner').default;
module.exports = () => (<ReactSmartbanner title={'Your Title'} />);
}
else {
module.exports = () => (<span/>);
}
Similar to @danielzlotnik, the right solution is to move all your client side code into componentDidMount since that renders only on the client.
Hello!
Based on #6, i had the same issue(window is not defined). I would like to know if have you plans to do SSR. I would like do prepare some PR. Could be a good idea?