From e33767a36daf7901cb46854b6612dd52b0dbdeec Mon Sep 17 00:00:00 2001 From: Diego Segura Date: Thu, 22 Feb 2024 09:03:03 -0800 Subject: [PATCH] fix flatlist props being undefined in ios (#43141) Summary: When using Flatlist on iOS and Android its failing because props are undefined The problem is described on https://github.com/facebook/react-native/issues/34783 ![Captura de pantalla 2024-02-22 a las 4 13 11](https://github.com/facebook/react-native/assets/1161455/325738d9-2e49-44a0-bb6a-077b2e02e9cd) ![Captura de pantalla 2024-02-22 a las 4 14 58](https://github.com/facebook/react-native/assets/1161455/118f76e1-a818-428e-938e-123b55536b49) Fixed by setting constructor before any statement and removing unnecessary props declaration at the top of the class. ## Changelog: [GENERAL] [FIXED] - Fix undefined props crash in FlatList Pull Request resolved: https://github.com/facebook/react-native/pull/43141 Reviewed By: javache Differential Revision: D54069559 Pulled By: robhogan fbshipit-source-id: b39cd9a273eb0279ed353f9efcb66a3c4ccf93b4 --- packages/react-native/Libraries/Lists/FlatList.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/react-native/Libraries/Lists/FlatList.js b/packages/react-native/Libraries/Lists/FlatList.js index 3d267cb95988ed..f34fe50f8721ee 100644 --- a/packages/react-native/Libraries/Lists/FlatList.js +++ b/packages/react-native/Libraries/Lists/FlatList.js @@ -308,7 +308,6 @@ export type Props = { * Also inherits [ScrollView Props](docs/scrollview.html#props), unless it is nested in another FlatList of same orientation. */ class FlatList extends React.PureComponent, void> { - props: Props; /** * Scrolls to the end of the content. May be janky without `getItemLayout` prop. */