negomi / react-burger-menu

:hamburger: An off-canvas sidebar component with a collection of effects and styles using CSS transitions and SVG path animations
http://negomi.github.io/react-burger-menu/
MIT License
5.04k stars 582 forks source link

pops up 2 errors when i try to dismount whole burger #471

Closed pacman-city closed 2 years ago

pacman-city commented 2 years ago

Hello, this is very usefull pachage.

I've got some errors: Element with ID 'page-wrap' not found Element with ID 'outer-container' not found

Error happends every time when i replace menu component(delete) with somthing else. I can't figure out why. Btw app does not crashes.

negomi commented 2 years ago

Hi @byteofmonkey,

When the menu component mounts, it adds styles to your page wrapper and outer container elements. When it unmounts (which it sounds like you are doing) it tries to remove those styles.

The error means it cannot find those elements in the DOM. This would happen if you already removed those elements.

It shouldn't affect any functionality if you have removed them, so you have two options:

  1. Remove the menu before you remove the page wrapper and outer container elements
  2. Just ignore the error

I hope that helps.

pacman-city commented 2 years ago

Thanks a lot! That's gotta be helpful. Or I'll have to follow option two)