Closed leonid-shevtsov closed 9 years ago
Haven't followed the official discussion. Is the "Note" about ES6 classes on https://facebook.github.io/react/docs/component-api.html#ismounted not relevant anymore? @leonid-shevtsov
It is relevant, and when you create an ES6 class that extends React.Component
it doesn't have isMounted
. But since you are creating the containers with React.createClass
, you're fine.
Transmit containers with this patch interop with ES6 classes as usual.
(It's the ES6 classes themselves that, in a similar situation, would have to resort to checking a flag set in componentWillUnmount()
or something like that. I hope that in the future the React team will work out a better solution.)
This is done to silence a warning in React:
See discussion at https://github.com/facebook/react/issues/2787
As this issue is unresolved and there is no final opinion from React devs, I think it's prudent to add a guard for the time being.