rsnext/examples/with-styletron/styletron.js
Vojtech Miksu 2433c11946
Update with-styletron example to not use DebugEngine (#20233)
[DebugEngine stopped working](https://github.com/styletron/styletron/issues/366) with v9.5 since the devtool is strictly set to eval and this option is not customizable. Unfortunately there is currently no way to fix this.
2020-12-29 16:39:12 +00:00

11 lines
286 B
JavaScript

import { Client, Server } from 'styletron-engine-atomic'
const getHydrateClass = () =>
document.getElementsByClassName('_styletron_hydrate_')
export const styletron =
typeof window === 'undefined'
? new Server()
: new Client({
hydrate: getHydrateClass(),
})