Skip to content

Commit 31da902

Browse files
committed
docs: change hardcoded name to field name
1 parent 8e34389 commit 31da902

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

docs/framework/react/guides/ssr.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ function Home() {
147147
return (
148148
<div>
149149
<input
150-
name="age"
150+
name={field.name}
151151
type="number"
152152
value={field.state.value}
153153
onChange={(e) => field.handleChange(e.target.valueAsNumber)}
@@ -293,7 +293,7 @@ export const ClientComp = () => {
293293
return (
294294
<div>
295295
<input
296-
name="age" // must explicitly set the name attribute for the POST request
296+
name={field.name} // must explicitly set the name attribute for the POST request
297297
type="number"
298298
value={field.state.value}
299299
onChange={(e) => field.handleChange(e.target.valueAsNumber)}

examples/react/next-server-actions/src/app/client-component.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export const ClientComp = () => {
3737
return (
3838
<div>
3939
<input
40-
name="age" // must explicitly set the name attribute for the POST request
40+
name={field.name} // must explicitly set the name attribute for the POST request
4141
type="number"
4242
value={field.state.value}
4343
onChange={(e) => field.handleChange(e.target.valueAsNumber)}

0 commit comments

Comments
 (0)