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

186
Visualizações
React, MaterialTable keep edit mode after state update, re-render

I have edit mode in my material table. Each row contains two dropdowns. First dropdown has static list of options on selection in the on change handler ajax call is made to fetch list of options for second dropdown, the response with list of options is saved in the state, which causes component re-render and and disables edit mode- which I dont want. I want to keep edit moda until I click save button. I wonder if there is some method/option that I can access via tableRef that could help me?

title: 'Category',
field: 'category',
editComponent: ({ value, onChange }) => (
  <Select
      fullWidth
      value={value ?? ''}
      onChange={(event) => {
           onChange(event.target.value);
           dispatch(actions.getSubcategoriesList(event.target.value)).then((data) => {
             setSubcategories(data);
           });
         }}
         style={{ backgroundColor: '#f06565' }}
       >
         {actualsCategories.map((cat) => (
           <MenuItem key={cat.id} value={cat.id}>
             {cat.name}
           </MenuItem>
         ))}
       </Select>
     ),

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