Pure render doc has a large note at the bottom that says:
Furthermore, shouldComponentUpdate skips updates for the whole component subtree. Make sure all the children components are also "pure".
People are using createContainer in lots of places and it isn't even clearly documented that you can change the options to not use pure. For instance using pure prevents context changes from filtering down to children if the props or state didn't change that is being passed to createContainer.
For anyone looking for how to do this here is an example of how you can stop using pure when calling createContainer:
import { Meteor } from 'meteor/meteor';
import { createContainer } from 'meteor/react-meteor-data';
import MyPage from '/imports/ui/layouts/MyPage.jsx';
export default createContainer({
getMeteorData: () => (
{
isLoggedIn: !!Meteor.userId(),
}
),
pure: false,
}, MyPage);
To be honest this just feels a bit clunky. I think I would rather have a createContainer call that looks something like this with an extra options param at the end:
export default createContainer(() => (
{
isLoggedIn: !!Meteor.userId(),
}
), MyPage, { pure: false });
Pure render doc has a large note at the bottom that says:
People are using createContainer in lots of places and it isn't even clearly documented that you can change the options to not use pure. For instance using pure prevents context changes from filtering down to children if the props or state didn't change that is being passed to createContainer.
For anyone looking for how to do this here is an example of how you can stop using pure when calling createContainer:
To be honest this just feels a bit clunky. I think I would rather have a createContainer call that looks something like this with an extra options param at the end: