Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

127
Vistas
React useContext and useMeo: State in Context is not updating

I have a Grid of which every cell accesses an update function onClick to mark the cell as clicked. During to the fact that I need to access the data of which cells are clicked later somewhere else I created a Context. I noticed the performance is getting very bad with a huge grid I wanted to minimize rerenders and wrapped the Cell Component called Node in useMemo so that it only rerenders if the className changes which colors the cell yellow if clicked. My Problem is that if I click on one cell it gets colored yellow but as I click on a second Cell the state Hook in the stateContexts.js doesnt remember the first clicked cell. If someone knows how to solve that I would be very thankful.

Here is codesandbox link: https://codesandbox.io/s/jovial-nobel-i1lg4

about 4 years ago · Santiago Gelvez
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda