I'm building a React website and started getting an error message that there is a memory leak. Long story short, I figured out the source of the leak and resolved it, or at least got the error message to disappear.
But when I take HEAP snapshots, there still appears to be a memory leak. I'm still getting several DetachedHTMLDivElements and a bunch of other detached items that I'm not sure are relevant. I've attached the snapshot below.

As someone new to web development, is it ever OK to have detached DOM elements? Are there situations where it's just unavoidable? Or should we always be eliminating these from our code?