React: Duplicate elements showing up on back press #1815
Closed
marcellino-ornelas
started this conversation in
General
Replies: 1 comment
-
Closing because I think this is a bug |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Just had the weirdest bug right now in my extension where pressing the back button would trigger duplicate elements to appear 🤔
we just do a basic
onMount
andonRemove
logic.All other actions like page refresh and FE navigation work tho! no problems and no duplicate elements. But the moment we pressed the back buttons, we got duplicates 🤔
I tried lots of things like removing the container in the onRemove function which didn't work. I would log out elements before and after the
elements?.container.remove();
and the div would always stay. its like the container was a old reference or something 🤔 or maybe when pressing back it no longer was considered in the DOM.Anyways wanted to share because I finally got it working by forcefully deleting all wxt divs with the following:
Probably a better solution to this but for now this works 🙌🏽
Beta Was this translation helpful? Give feedback.
All reactions