JSFiddle - React, Tailwind, and code Playground

JavaScript

str = 'test test test';
str = str.replace(' ','<br />');
console.log(str)