precharts
precharts copied to clipboard
Cannot read property 'parentElement' of undefined - Errors with [email protected]
I've been having some issues using this with the latest Preact; I was getting similar warnings on 7.x but now it's flat-out not working.
At the risk of providing a red-herring: I have a branch of my project that uses preact-router instead of react-router, and it seems to work just fine there? Not sure what gives...
The preact-router swap is an interesting data point. Maybe something is being removed immediately after state is being mutated on it?
If this.container is a ref, perhaps in prior versions of preact were re-calling the ref with a different element from a new route, and that is no longer happening in 8? If so, we could just change the ref handling to ignore null values:
containerRef = el => {
if (el!=null) this.container = el;
};
Not the best for memory, but it would mean the ref is still around during unmounts.
Oh, thanks pal