Allow render in SSR environment
Initial fix in relation to #85.
Simple fix to allow spaces to render in a SSR environment
- Check for existence of
document
before trying to apply styles - Added Next.js demo project to repo
This should allow spaces to be used in Next.js without error, however, this is not a full SSR implementation:
- Allows space content to render from server side
- Doesn't allow initial styles to be properly rendered server-side, however, client-side style hydration should kick in if .... all spaces are given a unique
id
prop to ensure consistency between server/client side renders.