JSFiddle - React, Tailwind, and code Playground

HTML

<input type="file" id="arquivo"/><br>
<iframe src="//fiddle.jshell.net/v54aqw40/show/light/" class="frame" id="frame"></iframe>

CSS

.frame {
    width: 98%;
    height: 350px;
    border: 1px solid #666;
}

JavaScript

$('#arquivo').change(function(e) {
    var _arq = URL.createObjectURL(e.target.files[0]);
    $("#frame").contents().find("#div").css('background-image','url('+_arq+')');
});