JSFiddle - React, Tailwind, and code Playground

HTML

<div class="list">
<div class="float">1</div>
<div class="float">2</div>
<div>anything other</div>
</div>

CSS

.float {
    float: left;
}
.list .float:last-child + div {
    clear: both;
}