4 ms·
This is probably a frequently asked question, but why doesn't React Native implement its own list views, rather than wrapping UITableView (for iOS) and ListView
by mwcampbell 11y ago
This is probably a frequently asked question, but why doesn't React Native implement its own list views, rather than wrapping UITableView (for iOS) and ListView (for Android)? I figured the latter approach would be the best way to address things like recycling native views.
- brentvatne 11y agoThe short answer is that UITableView is an inherently synchronous API whereas the React Native bridge is asynchronous -- UITableView calls cellForRowAtIndexPath:indexPath: and heightForRowAtIndexPath:indexPath: and you need to respond synchronously with the view for and the height of that cell. One of the problems with this is that under the current React Native architecture we would need to break the async bridge model by synchronously calling into JS in response to these methods. So some people are experimenting with a slightly different architecture that would allow us to respond to them synchronously from the main thread, which seems really promising :)