Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function generateHydrationScriptSrc(keys) {
var sanitizedKeys = safeString(JSON.stringify(keys));
return [
';try{',
'(function(){',
'window["', StyletronLegacy.constants.HYDRATE_KEY, '"]=', sanitizedKeys, ';',
'})();',
'}catch(e){};',
].join('');
}
function CompatComponent(props, context) {
if (context.styletron) {
var styleName = context.styletron.injectDeclaration({prop: 'color', val: 'red'});
return React.createElement('div',
{className: styleName}, 'I am a compat component');
} else {
styletronLegacy.injectOnce('.compatStyle { color: red }', '__compat_style__');
return React.createElement('div',
{className: 'compatStyle'}, 'I am a compat component');
}
}