Skip to content

Instantly share code, notes, and snippets.

Last active July 10, 2022 14:10
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
import api from '~/common/api'
const LoginForm = () => {
const [email, setEmail] = useState('')
const [password, setPassword] = useState('')
const handleSubmit = async (evt) => {
await api.login(email, password)
return (
<form onSubmit={handleSubmit}>
<input type="email" value={email} onChange={e => setEmail(} />
<input type="password" value={password} onChange={e => setPassword(} />
<button type="submit">Log in</button>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment