Hacker News new | ask | show | jobs
by LeanderK 3434 days ago
i don't know anything about React, but why can't react itself try to manage this?
2 comments

React is in the business of limiting its API surface, not increasing it. I think they have done a great job of it - libraries like this should exist in userland.
It seems like React could listen for visibilitychange itself to throttle its own events or virtual DOM processing. It wouldn't necessarily need to expose visibilitychange as a library API.
Because there is no sufficient magic for that. App developers have to think about when they do work, how much work they do, and if and when it should be rendered. For any rule you can give, I can give you an example of an app that would break.

In general, the mantra for people who find this tough to fix should be, "Why didn't I use MVC, what a cretin I was!"