Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rehydration in SSR with ES6 Imports #342

Open
levsthings opened this issue Nov 3, 2017 · 0 comments
Open

Rehydration in SSR with ES6 Imports #342

levsthings opened this issue Nov 3, 2017 · 0 comments

Comments

@levsthings
Copy link

levsthings commented Nov 3, 2017

Based on the discussions in #37, the following approach still seems to be only viable option to rehydrate if you're using ES6 imports:

import React from 'react'
import ReactDOM from 'react-dom'
import { rehydrate } from 'glamor'

rehydrate(window._glam)
const App = require('components/App/App').default

ReactDOM.render(<App />, document.getElementById('root'))

This is a workaround for the order of execution and if you only use ES6 imports instead, you get duplicate styles.

Users are warned about this caveat in the docs, but I'm just wondering if anyone has come up with a better solution since last time this was discussed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant