3 ms·
This is such a classic UI programming bug, and almost every UI programming framework has a way to achieve this accidentally using core components. React is noto
by danpalmer 3y ago
This is such a classic UI programming bug, and almost every UI programming framework has a way to achieve this accidentally using core components. React is notorious for this, but even in non-declarative frameworks it's very easy to get a reactivity loop on a trigger or model update and do this.
- 4death4 3y agoIt’s way easier in declarative frameworks, though.
- jondwillis 3y agoYes, but only because you aren’t re-rendering when data changes (which is half of the entire point of an UI) implicitly. Having worked on enough imperative UI kludge, I think that declarative probably saves enough dev-hours (and associated calories, Typescript, Swift, Rust, etc. compile time) to outweigh the infinite loop bugs.
- 4death4 3y agoI meant it’s way easier [to enter an infinite render loop] in declarative frameworks.
- danpalmer 3y agoI would say it's way easier to define an infinite render loop in declarative frameworks, and therefore it's easier to notice the issue and address it. Causes and fixes are just more obvious. I don't think it's much harder to infinitely update properties that cause a redraw in a non-declarative framework, but doing so probably has less impact because it often won't redraw the entire screen, and may do less work overall because of how the framework is structured.