coreui-free-react-admin-template icon indicating copy to clipboard operation
coreui-free-react-admin-template copied to clipboard

TypeError: target.className.includes is not a function

Open jagtarsinghwork opened this issue 5 years ago • 2 comments

When we click on Sidebar icon in core 4.0 admin template it will give this error

kindly describe me How can i fix this issue

TypeError: target.className.includes is not a function handleOnClick C:/Users/jagta/OneDrive/Documents/BRSOFTECH/USA JOBS/src/components/sidebar/CSidebar.tsx:128

125 | 126 | const handleOnClick = (event: Event) => { 127 | const target = event.target as HTMLAnchorElement

128 | target && | ^ 129 | target.className.includes('nav-link') && 130 | !target.className.includes('nav-group-toggle') && 131 | mobile &&

Before opening an issue:

When asking general "how to" questions:

  • Please do not open an issue here

When reporting a bug, include:

  • Operating system and version (Windows, Mac OS X, Android, iOS, Win10 Mobile)
  • Browser and version (Chrome, Firefox, Safari, IE, MS Edge, Opera, Android Browser)
  • Reduced test cases and potential fixes using CodePen or JS Bin

When suggesting a feature, include:

  • As much detail as possible for what we should add and why it's important to CoreUI Admin Template
  • Relevant links to prior art, screenshots, or live demos whenever possible

jagtarsinghwork avatar Jun 28 '21 07:06 jagtarsinghwork

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions

github-actions[bot] avatar Jan 23 '22 14:01 github-actions[bot]

this error shows, coz there is no class in your targeted element, when you click something svg which was wrapper by div and you write logic to wrapper div, but when you click you still targeted svg, and svg has no class, every class logic was in div wrapper

theavazov avatar Mar 22 '24 05:03 theavazov