Skip to content

Commit 22325ce

Browse files
committed
Merge remote-tracking branch 'origin/main' into v4
2 parents 6c12292 + 0ef05bf commit 22325ce

File tree

2 files changed

+4
-6
lines changed
  • examples
    • example-app-router-playground/src/app/[locale]/actions
    • example-app-router-without-i18n-routing/src/app/login

2 files changed

+4
-6
lines changed

examples/example-app-router-playground/src/app/[locale]/actions/ZodForm.tsx

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use client';
22

3-
import {ReactNode} from 'react';
4-
import {useFormState} from 'react-dom';
3+
import {ReactNode, useActionState} from 'react';
54
import {FormResult} from './ZodFormExample';
65

76
type Props = {
@@ -10,7 +9,7 @@ type Props = {
109
};
1110

1211
export default function ZodForm({action, children}: Props) {
13-
const [state, formAction] = useFormState(action, null);
12+
const [state, formAction] = useActionState(action, null);
1413
const hasErrors = state && !state.success;
1514

1615
return (

examples/example-app-router-without-i18n-routing/src/app/login/LoginForm.tsx

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use client';
22

3-
import {ReactNode} from 'react';
4-
import {useFormState} from 'react-dom';
3+
import {ReactNode, useActionState} from 'react';
54
import LoginFormErrors from './LoginFormErrors';
65
import {LoginFormResult} from './page';
76

@@ -16,7 +15,7 @@ export default function LoginForm({
1615
header: ReactNode;
1716
submit: ReactNode;
1817
}) {
19-
const [state, formAction] = useFormState(action, null);
18+
const [state, formAction] = useActionState(action, null);
2019

2120
return (
2221
<form

0 commit comments

Comments
 (0)