reactions/component

Include forceUpdate in shouldUpdate()

infinnie opened this issue · 2 comments

We sometimes want to write the shouldComponentUpdate() function like this:

shouldComponentUpdate() {
    requestAnimationFrame(this.forceUpdate.bind(this));
    return false;
}

So maybe a reference to the forceUpdate method should be passed to the shouldUpdate property, or why is this approach wrong?

I think shouldComponentUpdate should be pure. I'm not sure.