0

Using Material-UI icons like <AddOutlinedIcon /> as shown below, how can I actually make the icon appear in my nav menu as atm it displays the tags/word <AddOutlinedIcon /> before my menu name?

Unsure if I need to escape this inorder to display actual icon?

It should actually be displaying a + icon before my menu name.

  const menuList = [];

  myMenu.map(menuListItem =>
    menuList.push({
      id: menuListItem.manu_name,
      icon: '<AddOutlinedIcon />',          
      active: false
    })
  )
2
  • nit: You can change map to forEach. Commented Aug 11, 2021 at 10:23
  • How are you using the menuList? Please post a minimal reproducible code. Commented Aug 11, 2021 at 10:26

1 Answer 1

0

Have you tried removing the AddOutlinedIcon as a string value?

  const menuList = [];

  myMenu.map(menuListItem =>
    menuList.push({
      id: menuListItem.manu_name,
      icon: <AddOutlinedIcon />,          
      active: false
    })
  )
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.