Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
render() {
let themeSwitcher;
function supportsCSSVars() {
return window.CSS && window.CSS.supports && window.CSS.supports('(--fake-var: 0)');
}
if (supportsCSSVars()) {
themeSwitcher = (
<div>
<label> Theme: </label>
<select value="{this.state.theme}" id="theme">
<option value="">Default</option>
<option value="{ThemeProvider.Opts.Themes.MOCK}">Mock Theme</option>
</select>
</div>
);
} else {
themeSwitcher = (
<div>
);
}
return (
<div>
<div>{themeSwitcher}</div>
<div>
Themable component
</div></div></div>