У меня есть Field
из Redux-Form:
<Field
name="hours"
type="number"
initialValue="100"
placeholder="Ingrese las horas para esta categoría"
component={RenderInput}
onChange={(event) => {
handleSubmit(currentValues => this.debounceSubmitProduction({
...currentValues,
hours: event.target.value,
}))();
}}
/>
И я хотел передать начальное значение компоненту ввода initialValue="100"
, но теперь значение появляется во входе, но я не могу его отредактировать.
Это мой компонент RenderInput:
const RenderInput = ({
input,
type,
disabled,
readOnly,
placeholder,
meta: { touched, error },
onKeyDown,
innerRef,
initialValue,
}) => (
<div>
<input
{...input}
type={type}
value={initialValue}
disabled={disabled}
readOnly={readOnly}
placeholder={placeholder}
className={`font-300 ${touched && error && 'has-error'}`}
onKeyDown={onKeyDown}
ref={innerRef}
/>
</div>
);
Как мне отредактировать начальное значение, переданное на вход?