Add value prop
This commit is contained in:
parent
32f864baa6
commit
ed59762c71
1 changed files with 3 additions and 1 deletions
|
|
@ -4,6 +4,7 @@ import './index.scss'
|
||||||
interface Props {
|
interface Props {
|
||||||
fieldName: string
|
fieldName: string
|
||||||
placeholder: string
|
placeholder: string
|
||||||
|
value?: string
|
||||||
error: string
|
error: string
|
||||||
onBlur?: (event: React.ChangeEvent<HTMLInputElement>) => void
|
onBlur?: (event: React.ChangeEvent<HTMLInputElement>) => void
|
||||||
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void
|
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void
|
||||||
|
|
@ -17,9 +18,10 @@ const Fieldset = React.forwardRef<HTMLInputElement, Props>(function fieldSet(pro
|
||||||
<input
|
<input
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
className="Input"
|
className="Input"
|
||||||
name={props.fieldName}
|
|
||||||
type={fieldType}
|
type={fieldType}
|
||||||
|
name={props.fieldName}
|
||||||
placeholder={props.placeholder}
|
placeholder={props.placeholder}
|
||||||
|
defaultValue={props.value || ''}
|
||||||
onBlur={props.onBlur}
|
onBlur={props.onBlur}
|
||||||
onChange={props.onChange}
|
onChange={props.onChange}
|
||||||
ref={ref}
|
ref={ref}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue