JSFiddle - React, Tailwind, and code Playground
HTML
<!DOCTYPE html>
<html>
<head></head>
<body>
<input type='file' id='fileName' name='fileName' capture='user' accept='image/*' onchange="document.getElementById('myImg').src = window.URL.createObjectURL(this.files[0])">
<p><img src='#' id='myImg'></p>
</body>
</html>