Skip to content

Commit 151aebb

Browse files
committed
code improvements
1 parent 51d984e commit 151aebb

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

app/views/RoomView/List/components/InvertedScrollView.tsx

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -87,17 +87,13 @@ const InvertedScrollView = forwardRef<InvertedScrollViewRef, ScrollViewProps>((p
8787
};
8888

8989
node.getScrollRef = () => node;
90-
91-
if (typeof node.setNativeProps !== 'function') {
92-
node.setNativeProps = (nativeProps: object) => {
93-
// Check again if the underlying node has the method hidden
94-
if (node && typeof (node as any).setNativeProps === 'function') {
95-
(node as any).setNativeProps(nativeProps);
96-
}
97-
};
98-
}
90+
const originalSetNativeProps = (node as any).setNativeProps;
91+
if (typeof originalSetNativeProps !== 'function') {
92+
node.setNativeProps = (_nativeProps: object) => {
93+
};
94+
}
9995
}
100-
});
96+
}, []);
10197

10298
// Callback Ref to handle merging internal and external refs
10399
const setRef = (node: NativeScrollInstance | null) => {

0 commit comments

Comments
 (0)