Optimize code condition
Unanswered
Japanese Bobtail posted this in #help-forum
Japanese BobtailOP
Since the update of tailwindcss from v3 to v4 i have to change my code from this...
to this...
Okay its not a big deal. Is it possible to add the data-active attribute only, if the condition is true?
Thanks for help.
data-active={origin == item.link.split('/')[1]}
to this...
data-active={origin == item.link.split('/')[1] ? true : null}
Okay its not a big deal. Is it possible to add the data-active attribute only, if the condition is true?
Thanks for help.