score:1

Accepted answer

just add index in onsubmit like this:

onsubmit={onsubmit(index)}

Related Query

More Query from same tag