JSFiddle - React, Tailwind, and code Playground

HTML

<input type="date" name="dia" />

JavaScript

var Hoje = new Date();

dia = Hoje.getDate();
mes = Hoje.getMonth() + 1;
ano = Hoje.getFullYear();

var data = [ano, mes, dia].map(function (nr) {
    return (nr + '').length == 1 ? '0' + nr : nr;
});

document.querySelector('input[name="dia"]').value = data.join('-');