Skip to content

Commit 4993dd3

Browse files
committed
Fix potential undefined error in docs
1 parent 61e86da commit 4993dd3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docs/start/framework/testing.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ Consider a login form component that relies on `useActionData`
1717
import { useActionData } from "react-router";
1818

1919
export function LoginForm() {
20-
const { errors } = useActionData();
20+
const actionData = useActionData();
21+
const errors = actionData?.errors;
2122
return (
2223
<Form method="post">
2324
<label>

0 commit comments

Comments
 (0)