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

130
Visualizações
How to refactor and simplify a Drag-And-Drop code into smaller chunks

I created a prototype drag & drop functional component using react-beautiful-dnd. However, I am not so happy with the length of the code (like 250) lines and I think it should be better breakable.

Please find this example under this sandbox. I would like to hear your re-factoring advice how I can split the "right column" into a separate functional component, what kind of props and events need to be carried and how ??

Thanks in advance. Geo

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

0

OK, I will answer my own question for the sake of completeness and backward-reference :)

I was actually thinking that it would be needed to provide any DrapDropContext parameters in the split functional components: NOT NECESSARY.

The main point is to be able to carry the data object and integrity between these "outsourced components" and using a context was the solution for that. DrapDropContext was simply taking care of any behavioural details on the events.

Thanks for reading anyways. Geo

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