In console I see this warning:
index.js:2178 Warning: Body has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.
Body
component is using
...
import { observer, inject } from 'mobx-react';
...
@inject('store')
@observer
class Body extends React.PureComponent<BodyProps> {
...
but doesn't have this shouldComponentUpdate
method anywhere.
Is this coming from mobx-react
? Can I use PureComponent
in components decorated by @observable
or @inject
?
PureComponents should not be used in combination with observer
. Conceptually it is strange as observer makes components impure; as they can update without prop changes (which is actually the whole point of observer).
The upcoming mobx-react version will warn about this :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With