Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Avoiding CSS reflows in modern browsers should be pretty well documented, and I imagine it only makes sense to discuss reflows in a particular browser. @vjeux will cover more about the style/layout API in React Native tomorrow, but the main point I wanted to get across is that React Native's style rules are a limited subset that are generally cheaper to compute. More importantly - the result of these computations aren't given to the JS environment in a synchronous manner. You can't read/write/read/write style properties/computations and inadvertently trigger more reflows than necessary. I've seen that pattern make web experiences unusable. In React Native, reads must be done asynchronously, and they are batched together for efficiency. Not only is this one major footgun that React Native takes away, but the asynchronous nature also means that style computation (layout primarily) can be done in a different "pipeline" stage, which opens up future opportunity to parallelize that work with JS execution.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: