JSFiddle - React, Tailwind, and code Playground

HTML

<div style="display: grid; width: 5em;">
   <div style="word-wrap: break-word; min-width: 0;">
     first item with a longlonglongword
   </div>
   <div>
     second item
   </div>
 </div>