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

85
Vistas
Responsive between components

I built an animated box and stored chart inside. The chart will be responsive with animation. enter image description here

I control responsiveness with this code in the chart component.

  onclick = function () {
  myChart.resize();
};

The problem is when dealing with multiple charts. I built a chart stored in the other animated box. I want to resize these two charts by clicking on them, but it doesn't work. enter image description here

I've been trying to figure out how to pass data between components, but so far I can't seem to get it to work. Does anyone have a better way to do this?

・This is my code

https://codesandbox.io/s/echarts-test2-3vg2t?file=/src/chart.js

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Regarding Data and how it can be accessed in Sibling Components.

We must note few things about React.

  1. React follows one-way data flow (which means data is passed via props to children from the parent and not the other way around).
  2. Using only React(without any library), We can access data within siblings when we have data in the individual components. So, you would need to lift the state up (Use all the components data in the parent component and pass them as props).
  3. The other option is to use a library like Redux which has single source of truth and all the data is in Store from which components can directly access the data without passing props down (or without prop-drilling).
  4. The same can be achieved by using React-Hooks and Context API in React.

These official docs from react can be helpful:

  1. https://react-redux.js.org/introduction/getting-started
  2. https://reactjs.org/docs/hooks-reference.html
about 4 years ago · Juan Pablo Isaza Denunciar
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