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

228
Visualizações
How to unselect the menu.item (ant) if using the menu inside one component?

i have used menu and menu.item from ant , but im facing one issue BC im using one react component to draw the menu for a list array that includes menus and submenus .

enter image description here

this how it's look

and this is my code

 <StyledCollapse ghost>
          {categoriesTree ? (
            categoriesTree.map((item, index) => {
              return (
                <Panel key={index} header={<StyledCategoryRow>{item.name}</StyledCategoryRow>}>
                  <StyledMenu multiple={false}>
                    {item.names.map((category, index) => {
                      return (
                        <StyledPlanMenuItem key={index}>
                          <Row align="middle" gutter={[8, 0]}>
                            <Col span={24}>
                              <Link to={getUrl(`/${category.name.replace(/\s/g, '')}`)}>
                                {category.name}
                              </Link>
                            </Col>
                          </Row>
                        </StyledPlanMenuItem>
                      );
                    })}
                  </StyledMenu>
                </Panel>
              );
            })
          ) : (
            <Spin />
          )}
        </StyledCollapse>

i want to select only one menu.item at one time

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

0

  1. Make sure that there are no duplicate keys. 2.Still if the issue doesn't resolve you can use refs from react to handle click event. for more you can take reference from official site: https://reactjs.org/docs/hooks-reference.html#useref
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