Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enviar a task ao confirmar com "Enter" #3

Open
kinerik opened this issue Mar 14, 2021 · 1 comment
Open

Enviar a task ao confirmar com "Enter" #3

kinerik opened this issue Mar 14, 2021 · 1 comment

Comments

@kinerik
Copy link

kinerik commented Mar 14, 2021

Podemos enviar a task com a tecla "Enter" adicionando:

return (
    <form
      onSubmit={event => {
        event.preventDefault()
      }}
    >
...
@kinerik
Copy link
Author

kinerik commented Mar 18, 2021

Como já era de se esperar!

O Diego trata sobre isso muito bem no Chapter II > 4.Modal & Forms > Salvando dados do form!

Sobretudo com um excelente exemplo em Typescript.

import { FormEvent } from 'react'

function handleCreateNewTransaction(event: FormEvent) {
  event.preventDefault();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant