JSFiddle - React, Tailwind, and code Playground
HTML
<input type="date" id="test" />
JavaScript
if ( $('#test')[0].type != 'date' ) $('#test').datepicker();
<input type="date" id="test" />
if ( $('#test')[0].type != 'date' ) $('#test').datepicker();