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

229
Views
Cómo pasar accesorios a través de componentes de React sin usar Redux

¡Que pasa chicos! ¿Puedo tener alguna ayuda para entender este desafío de evaluación? Ya lo envié, pero una horrible duda sigue dando vueltas en mi cabeza:

Me ordenaron completar una aplicación React simple, que carga la entrada del usuario en un componente y pasa esos datos como accesorios a otro componente, renderizado desde otro. Algo como esto:

 function DataInput(){ const [input, setInput]=useState({ firstName:'', lastName:'', phone:'', )} function handleChange(e){ setInput({ ...input, [e.target.name]:e.targe.value; )} } function handleSubmit(){ /* dunno if this function is usefull to something. Can't figure out how to pass props from a child ( DataInput ) to another one ( ContactList)without using Redux to store a Global State. */ } return( <form> <input type="text" name="firstName" placeholder="First Name" value={input.firstName} onChange={handleChange} /> <input type="text" name="lastName" placeholder="Last Name" value={input.lasttName} onChange={handleChange} /> <input type="text" name="phone" placeholder="Phone Number" value={input.phone} onChange={handleChange} /> <button onClick={handleSubmit}>Add User</button> </form> )} function ContactList(props){ return( <div> <label>{props.firstName}</label> <label>{props.lastName}</label> <label>{props.phone}</label> </div> )} function App(){ render(){ <IngresoDatos /> <ContactList /> } } ReactDOM.render(<App/>, document.getElementById('root'))
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!