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

171
Vistas
Can you mount a React class programmatically?

I am trying to implement the mvvm pattern with React.I am currently doing this by building a "dumb" component (the view) that depends on a "viewModel" function. The function returns all the relevant state and business logic (like event handlers etc.).

I am wondering if I can use this same method but with a react Class instead of a React function. I have added a simple counter example trying to implement this idea. I have access to the state but when I click on the increase count button I get an error: Warning: Can't call setState on a component that is not yet mounted.

https://codesandbox.io/s/purple-sound-ogerg?file=/src/App.js

about 4 years ago · Juan Pablo Isaza
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