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

148
Visualizações
How do lodash's isEqual returns true while comparing two objects that have functions in Javascript/React?

I am trying to understand why/how this comparison gets true? As I know, if there is/are function/s in objects it will never be equal because every time parent renders their references change. Why does this equal?

// _.isEqual comes from lodash
shouldComponentUpdate(nextProps){
   const myQuestion = _.isEqual(nextProps, this.props) // this is getting true and my question for this line
   return !_.isEqual(nextProps, this.props)
}
// this is my props
{ 
    "dispatch": function(){},
    "saveHeaderSettings": function(){},
    "buttonFormat": "absolute",
    "externalUpdateEnable": false,
    "isEditModeAllowed": true,
    "isVisiblePivotView": false,
    "isWorkInSubsetEnabled": false,
    "mode": 0,
    "rowUpdateEnable": false,
    "updateMode": 0,
    "updateModes": {
        "isVisibleCellUpdate": true,
        "isVisibleRowUpdate": true,
        "isVisiblePopupUpdate": true
    }
}

PS: dispatch and saveHeaderSettings methods are coming from Redux's mapDispatchToProps

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