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

120
Vistas
Importing a variable from dynamically imported component

I have a (Map) component dynamically imported to my page.

const Map = dynamic(() => import('../components/Mapcomp'), { ssr: false, })

From that component I also want to import a variable.

const [taskImg, setTaskImg] = useState(null);


export {taskImg};

The component is dynamically imported because otherwise I get a window is not defined error, and this is the solution for that. Same with the variable. If I want to import it I get the above error. But I need to use the taskImg variable in this page. How can I do that?

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

0

You can't export a state to another component you either need to use a state management library like redux or create a context which make the state available for all the other components

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