Skip to content

Commit c34eb6a

Browse files
authored
docs(react-form): fix invalid HTML markup in Form Composition (#1660)
<div> can not be child of <label> The HTML <label> tag should not contain a <div>, so this change replaces the <div> with a <span> Source: https://caninclude.onrender.com/caninclude?child=div&parent=label
1 parent 6938517 commit c34eb6a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/framework/react/guides/form-composition.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export function TextField({ label }: { label: string }) {
5757
const field = useFieldContext<string>()
5858
return (
5959
<label>
60-
<div>{label}</div>
60+
<span>{label}</span>
6161
<input
6262
value={field.state.value}
6363
onChange={(e) => field.handleChange(e.target.value)}
@@ -504,7 +504,7 @@ export default function TextField({ label }: { label: string }) {
504504

505505
return (
506506
<label>
507-
<div>{label}</div>
507+
<span>{label}</span>
508508
<input
509509
value={field.state.value}
510510
onChange={(e) => field.handleChange(e.target.value)}
@@ -560,7 +560,7 @@ function TextField({ label }: { label: string }) {
560560
const field = useFieldContext<string>()
561561
return (
562562
<label>
563-
<div>{label}</div>
563+
<span>{label}</span>
564564
<input
565565
value={field.state.value}
566566
onChange={(e) => field.handleChange(e.target.value)}

0 commit comments

Comments
 (0)