JSFiddle - React, Tailwind, and code Playground

HTML

<form action="" id="idDaMinhaForm">
    <input type="text" />
</form>

JavaScript

$('#idDaMinhaForm').on('keyup', function (e) {
    if (e.which != 13) return; // não é o "enter"
    console.log(this, e.target); // elemento form, elemento onde o "enter" foi acionado
    if (e.target.tagName.toLowerCase() == 'input') this.submit();
});