Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default function injectSheet(...rest) {
const createHoc = defaultInjectSheet.apply(this, rest)
return (InnerComponent) => {
const Jss = createHoc(InnerComponent)
class HotJss extends Jss {
componentWillMount() {
// Note: this will never be called during hot module replacement, so we can
// use it as a place to store away the SheetManager
super.componentWillMount()
managers.set(Object.getPrototypeOf(this), this.manager)
}
componentWillReceiveProps(nextProps, nextContext) {
super.componentWillReceiveProps(nextProps, nextContext)
const prevManager = managers.get(Object.getPrototypeOf(this))
const manager = this.manager