Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const { muiThemeProviderOptions } = this.context;
if (muiThemeProviderOptions) {
if (muiThemeProviderOptions.sheetsManager) {
this.sheetsManager = muiThemeProviderOptions.sheetsManager;
}
this.disableStylesGeneration = muiThemeProviderOptions.disableStylesGeneration;
}
// Attach the stylesCreator to the instance of the component as in the context
// of react-hot-loader the hooks can be executed in a different closure context:
// https://github.com/gaearon/react-hot-loader/blob/master/src/patch.dev.js#L107
this.stylesCreatorSaved = stylesCreator;
this.sheetOptions = _extends({
generateClassName
}, this.context[ns.sheetOptions]);
// We use || as the function call is lazy evaluated.
this.theme = listenToTheme ? themeListener.initial(context) || getDefaultTheme() : noopTheme;
}
const { muiThemeProviderOptions } = this.context;
if (muiThemeProviderOptions) {
if (muiThemeProviderOptions.sheetsManager) {
this.sheetsManager = muiThemeProviderOptions.sheetsManager;
}
this.disableStylesGeneration = muiThemeProviderOptions.disableStylesGeneration;
}
// Attach the stylesCreator to the instance of the component as in the context
// of react-hot-loader the hooks can be executed in a different closure context:
// https://github.com/gaearon/react-hot-loader/blob/master/src/patch.dev.js#L107
this.stylesCreatorSaved = stylesCreator;
this.sheetOptions = {
generateClassName,
...this.context[ns.sheetOptions],
};
// We use || as the function call is lazy evaluated.
this.theme = listenToTheme ? themeListener.initial(context) || getDefaultTheme() : noopTheme;
this.attach(this.theme);
}
if (muiThemeProviderOptions) {
if (muiThemeProviderOptions.sheetsManager) {
this.sheetsManager = muiThemeProviderOptions.sheetsManager;
}
this.disableStylesGeneration = muiThemeProviderOptions.disableStylesGeneration;
} // Attach the stylesCreator to the instance of the component as in the context
// of react-hot-loader the hooks can be executed in a different closure context:
// https://github.com/gaearon/react-hot-loader/blob/master/src/patch.dev.js#L107
this.stylesCreatorSaved = stylesCreator;
this.sheetOptions = _objectSpread({
generateClassName
}, context[ns.sheetOptions]); // We use || as the function call is lazy evaluated.
this.theme = listenToTheme ? themeListener.initial(context) || getDefaultTheme() : noopTheme;
this.attach(this.theme);
this.cacheClasses = {
// Cache for the finalized classes value.
value: null,
// Cache for the last used classes prop pointer.
lastProp: null,
// Cache for the last used rendered classes pointer.
lastJSS: {}
};
}
constructor(props, context) {
super(props, context);
this.jss = this.context[ns.jss] || jss;
this.sheetsManager = this.context.sheetsManager || sheetsManager;
this.stylesCreators = stylesCreators;
this.sheetOptions = {
generateClassName,
...this.context[ns.sheetOptions]
};
this.theme = themeListener.initial(context) || getDefaultTheme();
this.state = {};
}