scrimba
Learn React Router
Actions
Action function - params
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

Action function - params
AboutCommentsNotes
Action function - params
Expand for more info
Login.jsx
run
preview
console
import React from "react"
import { useNavigate, Form } from "react-router-dom"

export async function action(obj) {
console.log(obj)
return null
}

export default function Login() {
return (
<Form method="post">
<input
type="email"
name="email"
placeholder="Email address"
/>
<br />
<input
type="password"
name="password"
placeholder="Password"
/>
<br />
<button>Log in</button>
</Form>
)
}
Console
/login
-1:37