Illogical architecture of setState
Dear React developers and community. Can anyone please explain to me why React throws a hard error if I use setState (or anything that entails setting new state, e.g. replaceState) if setState should work ONLY on a mounted component? If it never works with unmounted component, than what's the harm in using console.warn instead? Because in ALL our code we must use this.isMounted() && this.setState() — which is completely redundant.
Can you please provide an explanation for this? Can you allow using a certain init option for not throwing this error?
https://github.com/facebook/react/issues/2787#issuecomment-68738793
Going to close this out and just refer to that other issue. Let me know if there isn't enough there to answer your questions and give you an idea of the direction we're heading.