const header = document.querySelector(`.header`);
if (условие) {
header.classList.add(`active`);
}
const box = props => {
const deff = ['deff']
if (props.name !== '') {
deff.push('metal')
} else {
deff.push('energ')
}
return (
<input
className={deff.join(' ')}
/>
)
}
const classNames = require('classnames');
const box = props => {
const inputClass = classNames('deff', {
metal: props.name,
energ: !props.name
});
return <input className={inputClass} />;
}