Skip to content

Commit

Permalink
Prepare to make React.Element fully opaque (facebook#40798)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebook#40798

Changelog: [Internal]

Reviewed By: sullenor

Differential Revision: D50194982

fbshipit-source-id: 21d2f86dd787952ceed9a4f862a3fcaa2b063349
  • Loading branch information
SamChou19815 authored and facebook-github-bot committed Oct 12, 2023
1 parent 02e53eb commit 11d9b9c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class AppendingList extends React.Component<
nestedScrollEnabled
style={styles.scrollView}>
{this.state.items.map(item =>
// $FlowFixMe[prop-missing] React.Element internal inspection
React.cloneElement(item, {key: item.props.msg}),
)}
</ScrollView>
Expand All @@ -94,6 +95,7 @@ class AppendingList extends React.Component<
}}
style={[styles.scrollView, styles.horizontalScrollView]}>
{this.state.items.map(item =>
// $FlowFixMe[prop-missing] React.Element internal inspection
React.cloneElement(item, {key: item.props.msg, style: null}),
)}
</ScrollView>
Expand Down
2 changes: 2 additions & 0 deletions packages/virtualized-lists/Lists/VirtualizedList.js
Original file line number Diff line number Diff line change
Expand Up @@ -969,10 +969,12 @@ class VirtualizedList extends StateSafePureComponent<Props, State> {
{React.cloneElement(element, {
onLayout: (event: LayoutEvent) => {
this._onLayoutEmpty(event);
// $FlowFixMe[prop-missing] React.Element internal inspection
if (element.props.onLayout) {
element.props.onLayout(event);
}
},
// $FlowFixMe[prop-missing] React.Element internal inspection
style: StyleSheet.compose(inversionStyle, element.props.style),
})}
</VirtualizedListCellContextProvider>,
Expand Down

0 comments on commit 11d9b9c

Please sign in to comment.