transform
<div className={arrayOrObjectExpr}></div>
to
<div className={classNames(arrayOrObjectExpr)}></div>
<button className={`${active ? 'btn-active' : ''} ${disabled ? 'btn-disabled' : ''}`}>
</button>
with classnames
<button
className={classNames({
'btn-active': active,
'btn-disabled': disabled,
})}>
</button>
<button
className={{
'btn-active': active,
'btn-disabled': disabled,
}}>
</button>
npm i babel-plugin-jsx-classnames --save-dev
{
"presets": [
"env",
"react"
],
"plugins": [
...
"jsx-classnames"
]
}