Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

215
Views
Redux-from con useState: ¿cómo conectarse con el valor de redux?

¿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.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!