interface FieldWithLabelProps {
id: string
ref: HTMLInputElement
label: string
field: JSX.Element <--- How to narrow down to permit only <input>?
}
const FieldWithLabel: Component<FieldWithLabelProps> = (props) => {
return (
<div>
<div><label for={props.id}>{props.label}</label></div>
<div>{props.field}</div> <--- How to apply "id" attribute and props.ref to props.field?
</div>
)
}
interface FieldWithLabelProps {
id: string
ref: HTMLInputElement
label: string
field: JSX.Element <--- How to narrow down to permit only <input>?
}
const FieldWithLabel: Component<FieldWithLabelProps> = (props) => {
return (
<div>
<div><label for={props.id}>{props.label}</label></div>
<div>{props.field}</div> <--- How to apply "id" attribute and props.ref to props.field?
</div>
)
}