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

111
Views
volver a renderizar cuando cambie el estado en otro componente

tengo 2 archivos setter.jsx y active.jsx

setter.jsx

 function SetState() { const [State, setState] = useState("default state"); const setter = (options) => { setState(options); }; const getter = () => { return State; }; return { State, setter, getter }; }

en algún lugar de setter.jsx

 const {setter} = SetState(); setter(options);

en activo.jsx

 import {SetState} from "setter"; const {State} = SetState(); return {State};

cuando se llama a setter() en setter.jsx , el estado cambia pero luego active.jsx sigue devolviendo el estado predeterminado. ¿Cómo puede active.jsx volver a renderizar y devolver el nuevo valor cada vez que se llama a setter en setter.jsx ?

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!