I'm getting this error when trying to render a component:
Cannot read property 'purgeUnmountedComponents' of undefined
What does it mean and how can I fix it?
If you load the minified react.min.js with the unminified react-dom.js then you get this error when using version 15.4.
To fix it, you should use the unminified copy of both files or the minified copy of both files – don't mix and match.
We should likely change the behavior here so you don't get a cryptic error.
I got this problem using both minified react.min.js and minified react-dom.min.js occasionally, here is the log:
Fixed by using unminified files, wish this problem will be fixed in minified files.
@chaotyler
Please provide a project reproducing the problem.
im new in react js looking for tutorials for it
@gaearon
I'm kind of finding out the reason, I'm using server-side rendering and re-render the hole page in the browser-side, here is the simplest example to reproduce this problem:
now.getSeconds()
, so the error was not showed every time)It is the coding problem in my component, but the error messages(different using different react libs) are not friendly, for example:
Using react.js and react-dom.js(this is the error message I really need)
Using react.min.js and react-dom.js:
Using react.min.js and react-dom.min.js:
Try my demo: https://github.com/chaotyler/mini_react_problem_demo
Yes, We should be using either both minified or un minified version!
I’ll close since this error doesn’t happen on master, and there is a clear solution for 15 (don’t mix minified and unminified files).
Most helpful comment
If you load the minified react.min.js with the unminified react-dom.js then you get this error when using version 15.4.
To fix it, you should use the unminified copy of both files or the minified copy of both files – don't mix and match.
We should likely change the behavior here so you don't get a cryptic error.