The title might be confusing, so here is an example....
for (var i = 0; i < this.state.list.length; i++) {
<td className={'blah_'+this.state.list[i].id}></td>
}
This results in <td class="blah_1">
, but what if you need to put a hard-coded class name along with class="blah_1"
?
<td className={'blah_'+this.state.id, 'another-class'}></td>
This ended up <td class="another-class">
.
<td className={'blah_'+this.state.id} className="another-class></td>
So did this one.
So, my goal is to get <td class="blah_1 another-class">
, meaning that one is determined dynamically and the other is hard-coded. Sorry this question sounds too basic, but I'm new to react and can't find the answer in the official documentation.
I'd appreciate if you would give any insight.