Skip to content

Adding classNames helper function

Mahmoud Tarek requested to merge adding-classNames-helper-function into main
  • Adding a new helper function classNames
const innerClass = 'text-black border rounded'

//instead of using 
<div className={['w-full', innerClass].filter(Boolean).join(' ')}></div>

//use instead
<div className={classNames('w-full', innerClass)}></div>
Edited by Mahmoud Tarek

Merge request reports

Loading