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

278
Vistas
After i fetch data and add it to redux my react app throws error a variable is not defined

After i fetch data and add it to redux my react app throws error: Uncaught TypeError: Cannot read properties of undefined (reading 'embed') at line 371. Here is line 371:

<input name="color" type="color" className="color-pick" id="embed_color" ref={embedColor} defaultValue={config.guild.welcomeConfig.embed.embedColor} />

Here is the fetch:

export const saveWelcomeConfig = (guildId, config ) => 
    axios({
        method: 'POST',
        url: url + `config/${guildId}/savewelcome`,
        data: {
            welcomeConfig: config
        },
        withCredentials: true
    })

And here is the action:

export const saveWelcomeConfig = (config, guildId) => async (dispatch) => {
    try{
        const { data } = await api.saveWelcomeConfig( guildId, config )

        
        dispatch({
            type: 'SAVE_WELCOME_CONFIG',
            payload: data
        })
    }catch(err){
        console.log(err)
    }
}

And the embed is in my redux's state. After i refresh page its working. But i dont want to refresh the page.

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