Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

219
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!