• Empleos
  • Sobre nosotros
  • profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
  • empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Pruebas Online
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

203
Vistas
Error de reacción 185: conozco el problema, pero ¿cómo puedo llamar a setState una vez?

Aquí está el código relevante-

 CONFIG.theme.activeScheme ? react.createElement(SortBox, { onChange: this.updateColourScheme.bind(this), onnewschemes: this.setState({}), // TODO: Make this compatible with the changes to the theme install process: need to create a method to update the scheme options without a full reload. sortBoxOptions: generateSchemesOptions(CONFIG.theme.schemes), // It doesn't work when I directly use CONFIG.theme.activeScheme in the sortBySelectedFn // because it hardcodes the value into the fn sortBySelectedFn: (a) => a.key === this.getActiveScheme(), }) : null,

Mi resultado final preferido es poder recargar SOLO el componente sortbox usando un evento a través de onnewschemes (necesito actualizar todas las opciones dentro de un pequeño método desplegable desde fuera del renderizado). El despachador de eventos que tengo se ve al igual que:

 const schemeSelector = document.querySelector("div.marketplace-header > div > div"); const newSchemeEvent = new CustomEvent("newschemes", { bubbles: true, detail: { schemes: () => parsedSchemes }, }); schemeSelector.dispatchEvent(newSchemeEvent);
almost 3 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 Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda