Refactor Virtualized List to not use findNodeHandle when calling measureLayout

Summary:
In fabric, the measureLayout method expects 'node ref' instead of 'node handle'.
Node refs are supported by the current production version of RN and for Fabric, no changes should be expected in the current production version of RN

Reviewed By: TheSavior

Differential Revision: D15103116

fbshipit-source-id: cde94f61eaf6aa52ae4bd6f89082d18141d0da28
This commit is contained in:
David Vacca 2019-05-02 20:28:08 -07:00 коммит произвёл Facebook Github Bot
Родитель ee681b72ce
Коммит 4b98ac9295
1 изменённых файлов: 4 добавлений и 7 удалений

Просмотреть файл

@ -1139,19 +1139,16 @@ class VirtualizedList extends React.PureComponent<Props, State> {
// We are asuming that getOutermostParentListRef().getScrollRef() // We are asuming that getOutermostParentListRef().getScrollRef()
// is a non-null reference to a ScrollView // is a non-null reference to a ScrollView
this._scrollRef.measureLayout( this._scrollRef.measureLayout(
ReactNative.findNodeHandle( this.context.virtualizedList
this.context.virtualizedList .getOutermostParentListRef()
.getOutermostParentListRef() .getScrollRef()
.getScrollRef() .getNativeScrollRef(),
.getNativeScrollRef(),
),
(x, y, width, height) => { (x, y, width, height) => {
this._offsetFromParentVirtualizedList = this._selectOffset({x, y}); this._offsetFromParentVirtualizedList = this._selectOffset({x, y});
this._scrollMetrics.contentLength = this._selectLength({ this._scrollMetrics.contentLength = this._selectLength({
width, width,
height, height,
}); });
const scrollMetrics = this._convertParentScrollMetrics( const scrollMetrics = this._convertParentScrollMetrics(
this.context.virtualizedList.getScrollMetrics(), this.context.virtualizedList.getScrollMetrics(),
); );