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

199
Visualizações
Is there in React something like 'local' component Context?

I have a set of complex components with many inner parts in some array. On Click I need to create new one and to set in the array. But to deal with its complexity, the single complex component, I wanted to create for each its own 'Context' on the component creation or something similar to deal with its local property drill problems. I don't need redux because it global for all the components.

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

Let me put it in answer to point out couple of potential misconception which you might have.

You mentioned about local property drill problems

Below is the explanation of what prop drilling is, there is no such thing as local prop drill. Whenever you mention that you have prop drill problem, you will usually have many components involved

Prop drilling is the process in a React app where props are passed from one part of a tree to another by going through other parts that do not need the data, but only help in passing it through the tree

Second misconception which you might have

I don't need redux because it global for all the components.

Yes, Redux or React Context is available globally for all the components, but they are not accessible to redux by default. All the components do not have default access to redux store by default, in order to access the store, you will need connect or some hooks to access the store.

From the above two misconceptions, I hope you understand the problem that you are trying to solve

about 4 years ago · Juan Pablo Isaza Relatório

0

I seem to have found a solution. So when I create component with very nested structure I need just one global Context or Redux. In Redux/Context I store array/set of models/object of the complex component, not component itself. When I create the new complex component at the same moment we create the model of the complex component with its id. And each this complex component get reach its model by the id. It global, but we find a model by id, so its at the same time something local. Something like that...

about 4 years ago · Juan Pablo Isaza 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