Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

285
Visualizações
React error 185- I know the issue but how can I call setState once

Here's the relevant code-

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,

My preferred end result is to be able to reload JUST the sortbox component using an via the onnewschemes event(I pretty much need to refresh all of the options within a little drop down method from outside the render itself.) The event dispatcher i have looks like so:

const schemeSelector = document.querySelector("div.marketplace-header > div > div");
        const newSchemeEvent = new CustomEvent("newschemes", {
            bubbles: true,
            detail: { schemes: () => parsedSchemes },
        });
        schemeSelector.dispatchEvent(newSchemeEvent);
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda