removeClippedSubviews: Use at your own risk
In the docs here, it says Use at your own risk.
Can someone elaborate on the possible risks of using removeClippedSubviews?
I guess because it's experimental.
An experimental performance optimization for improving scroll perf of large lists, used in conjunction with overflow: 'hidden' on the row containers. Use at your own risk.
but I tend to think this is outdated and not anymore experimental, because it is now the default starting from RN 0.14:
https://github.com/facebook/react-native/releases/tag/v0.14.0-rc
or maybe it is still experimental? --> " If you see any issues please report them. "
I don't think it should default to true, I found that setting it to true at least in RN 0.13 caused the following issue: If you navigate from a listView with this set true and update the contents of that list view e.g. if the original list view is subscribed to changes, then the listview goes blank if you navigate back to it i.e. all views get clipped. @ide, is this a known issue?
Yes there's an issue with clipping. Not sure what the fix is though.
Hey @ide is there any update on a fix for the clipping? I see significant memory improvements when removeClippedSubviews is enabled, but with this clipping issue, can't really use it anywhere. I could probably implement a hackish workaround for my apps, but it's not wise or optimal.
No updates, but not using it is untenable too.
cc @nicklockwood :angel:
+1
https://facebook.github.io/react-native/docs/view.html#removeclippedsubviews has no explicit warning on it, now. (Perhaps it used to?)
Furthermore, it still has at least one additional bug: When dragging a child Animated.View from a parent view with this set on it out of, and back into the parent, the child vanishes, but continues responding to the gesture. The child then doesn't reappear until the parent is re-rendered. Removing this prop from the parent restores the expected functionality.
Am I right in this only effecting RN on iOS? I'm playing with setting shouldRasterizeIOS to true only when a view is inactive (e.g. lower in the nav stack or on another tab) and it looks like it is working ok at the moment.
Something like:
shouldComponentUpdate(props) {
let navDepth = this.props.navigator.getCurrentRoutes().length;
if (navDepth !== this._navDepth) {
this._navDepth = navDepth;
return true;
}
return this.props.selected !== props.selected;
}
render() {
return <View style={{flex: 1}} shouldRasterizeIOS={this.props.selected || this._navDepth > 1}>
...
}
Still testing, will let you know if it breaks. Has anyone else worked around this yet?
update doesn't work
Hi there! This issue is being closed because it has been inactive for a while.
But don't worry, it will live on with ProductPains! Check out its new home: https://productpains.com/post/react-native/removeclippedsubviews-use-at-your-own-risk
Product Pains has been very useful in highlighting the top bugs and feature requests: https://productpains.com/product/react-native?tab=top
Also, if this issue is a bug, please consider sending a pull request with a fix.