Hacker News new | ask | show | jobs
by mharroun 2377 days ago
Why not put the function calls into the render? And only decide to rerender on state change. You could push nearly all that logic back into extends Purecomponent
1 comments

They point out that the get* functions are supposed to be "computationally expensive", and you don't want something like that in your render method.

But also in either the current or near future versions of react, with Suspense and concurrent rendering, the render method may be called multiple times over the course of a single render. So if any of those functions aren't entirely pure, there is a good chance there will be bugs from that.