JSFiddle - React, Tailwind, and code Playground

HTML

<div id="target"></div>

JavaScript

$(function () {
    var name = "Review     1"
    $('#target').html(name.replace(/\s/g, '&nbsp;'));
});