¿Es posible sustituir el valor de useState con el que proviene de input? ¿O hay una manera de hacer esto usando el envío? Lo he intentado de muchas formas, pero ninguna funciona.
const renderInput = ({ input, label, type, meta: { asyncValidating, touched, error }, }) => { const [value, setValue] = useState('default state'); const onChange = event => { setValue(event.target.value); // + some logic here }; return ( <div> <label>{label}</label> <div className={asyncValidating ? 'async-validating' : ''}> <input {...input} value={value} onChange={onChange} type={type} placeholder={label} /> {touched && error && <span>{error}</span>} </div> </div> ); }; const SelectingFormValuesForm = props => { const { type, handleSubmit, pristine, reset, submitting } = props; return ( <form onSubmit={handleSubmit}> <div> <label>Name</label> <div> <Field name="name" component={renderInput} type="text" placeholder="Dish name..." /> </div> </div> </form> ); }; SelectingFormValuesForm = reduxForm({ form: 'selectingFormValues', validate, asyncValidate, // asyncBlurFields: ['name'], })(SelectingFormValuesForm); export default SelectingFormValuesForm;De esta manera, desafortunadamente, el valor enviado al envío permanece vacío.