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

216
Visualizações
Difference between `Provider` and `connect` in Redux for React

I see that with Redux there's two ways of passing down the state to the components in a React app, one is throw the Provider component and the other one with the connect functionality. However, I wonder why there's two different ways and which one is better in performance than the other.

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

They are not mutually exclusive. Actually you will almost always need to use Provider, even with connect (See: https://github.com/reactjs/react-redux/blob/master/docs/api.md#provider-store)

Without connect you would have to manually pass the store to components that need them, with nested components this gets messy, as you need to pass it down multiple levels, even through components that do not need the store if its children need the store.

over 4 years ago · Santiago Trujillo Relatório

0

Provider(component): Attaches app to store.Utilized at applications root and wraps entire application.

Connect (function): Creates container components.

over 4 years ago · Santiago Trujillo Relatório
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