Is this library compatible with Mobx?
I'm trying to adapt the why-did-you-render official example to run with Mobx 5.
As soon as I put a @observer decorator above BigListPureComponent, I stop getting any why-did-you-render console notifications.
@observer
class BigListPureComponent extends React.PureComponent {
static whyDidYouRender = true;
render() {
console.log(
"BigListPureComponent Re-Render! - We don't want to get here too often."
);
return (
<div style={this.props.style}>
<h2>BigListPureComponent</h2>
<div>
{times(3000).map(n => (
<div key={n}>Element #{n}</div>
))}
</div>
</div>
);
}
}
However, I still get the regular console.log notification, so it's clearly still being rendered unnecessarily. I've tried multiple permutations such as extending from React.Component, but as soon as I add in @observer it stops working.
Is there an example of this library working with Mobx or are they incompatible? I don't see any mention in the docs one way or the other. Thanks.
Is this library compatible with Mobx?
I'm trying to adapt the why-did-you-render official example to run with Mobx 5.
As soon as I put a
@observerdecorator aboveBigListPureComponent, I stop getting anywhy-did-you-renderconsole notifications.However, I still get the regular
console.lognotification, so it's clearly still being rendered unnecessarily. I've tried multiple permutations such as extending fromReact.Component, but as soon as I add in@observerit stops working.Is there an example of this library working with
Mobxor are they incompatible? I don't see any mention in the docs one way or the other. Thanks.