react-native icon indicating copy to clipboard operation
react-native copied to clipboard

RN Flat List

Open JoshuaSkootsky opened this issue 1 year ago • 4 comments

Description

Using the RN Flat List with no data yet, it crashes instead of rendering nothing.

Babel config: ['@babel/plugin-transform-private-methods', { loose: true }],

Steps to reproduce

Using the RN Flat List with no data yet, it crashes instead of rendering nothing.

Babel config: ['@babel/plugin-transform-private-methods', { loose: true }],

React Native Version

"react-native": "0.72.6",

Affected Platforms

Runtime - Android

Output of npx react-native info

$ npx react-native info
info Fetching system and libraries information...
System:
  OS: Linux 5.4 Ubuntu 20.04.6 LTS (Focal Fossa)
  CPU: (12) x64 Intel(R) Core(TM) i5-10600K CPU @ 4.10GHz
  Memory: 2.13 GB / 15.51 GB
  Shell:
    version: 5.0.17
    path: /bin/bash
Binaries:
  Node:
    version: 20.9.0
    path: ~/.nvm/versions/node/v20.9.0/bin/node
  Yarn:
    version: 1.22.10
    path: /usr/local/bin/yarn
  npm:
    version: 10.2.1
    path: ~/.nvm/versions/node/v20.9.0/bin/npm
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
IDEs:
  Android Studio: Not Found
Languages:
  Java:
    version: 11.0.21
    path: /usr/bin/javac
  Ruby:
    version: 2.7.0
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.72.6
    wanted: 0.72.6
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Stacktrace or Logs

TypeError: Cannot read property 'getItem' of undefined

This error is located at:
    in FlatList
    in NativeWind.FlatList
    in Unknown (created by Library)
    in RCTView (created by View)
    in View (created by Library)
    in Library
    in Unknown (created by Route(home/library))
    in Route (created by Route(home/library))
    in Route(home/library) (created by SceneView)
    in StaticContainer
    in EnsureSingleNavigator (created by SceneView)
    in SceneView (created by BottomTabView)
    in RCTView (created by View)
    in View (created by Screen)
    in RCTView (created by View)
    in View (created by Background)
    in Background (created by Screen)
    in Screen (created by BottomTabView)
    in RNSScreen
    in Unknown (created by InnerScreen)
    in Suspender (created by Freeze)
    in Suspense (created by Freeze)
    in Freeze (created by DelayedFreeze)
    in DelayedFreeze (created by InnerScreen)
    in InnerScreen (created by Screen)
    in Screen (created by MaybeScreen)
    in MaybeScreen (created by BottomTabView)
    in RNSScreenContainer (created by ScreenContainer)
    in ScreenContainer (created by MaybeScreenContainer)
    in MaybeScreenContainer (created by BottomTabView)
    in RCTView (created by View)
    in View (created by SafeAreaInsetsContext)
    in SafeAreaProviderCompat (created by BottomTabView)
    in BottomTabView (created by BottomTabNavigator)
    in PreventRemoveProvider (created by NavigationContent)
    in NavigationContent
    in Unknown (created by BottomTabNavigator)
    in BottomTabNavigator
    in Unknown (created by _layout)
    in _layout
    in Unknown (created by Route((auth)))
    in Route (created by Route((auth)))
    in Route((auth)) (created by SceneView)
    in StaticContainer
    in EnsureSingleNavigator (created by SceneView)
    in SceneView (created by QualifiedSlot)
    in QualifiedSlot (created by Slot)
    in PreventRemoveProvider (created by NavigationContent)
    in NavigationContent
    in Unknown (created by QualifiedNavigator)
    in QualifiedNavigator (created by Navigator)
    in Navigator (created by Slot)
    in Slot (created by InitialLayout)
    in InitialLayout (created by RootLayout)
    in StripeProvider (created by RootLayout)
    in AuthProvider (created by RootLayout)
    in ThemeProvider (created by PaperProvider)
    in RCTView (created by View)
    in View (created by Portal.Host)
    in Portal.Host (created by PaperProvider)
    in RCTView (created by View)
    in View (created by SafeAreaInsetsContext)
    in SafeAreaProviderCompat (created by PaperProvider)
    in PaperProvider (created by RootLayout)
    in RNGestureHandlerRootView (created by GestureHandlerRootView)
    in GestureHandlerRootView (created by RootLayout)
    in RootLayout
    in Unknown (created by Route())
    in Route (created by Route())
    in Route() (created by ContextNavigator)
    in RNCSafeAreaProvider (created by SafeAreaProvider)
    in SafeAreaProvider (created by wrapper)
    in RNGestureHandlerRootView (created by GestureHandlerRootView)
    in GestureHandlerRootView (created by GestureHandlerRootView)
    in GestureHandlerRootView (created by wrapper)
    in wrapper (created by ContextNavigator)
    in EnsureSingleNavigator
    in BaseNavigationContainer
    in ThemeProvider
    in NavigationContainerInner (created by ContextNavigator)
    in ContextNavigator (created by ExpoRoot)
    in ExpoRoot (created by App)
    in App (created by withDevTools(App))
    in withDevTools(App) (created by ErrorOverlay)
    in ErrorToastContainer (created by ErrorOverlay)
    in ErrorOverlay
    in RCTView (created by View)
    in View (created by AppContainer)
    in RCTView (created by View)
    in View (created by AppContainer)
    in AppContainer
    in main(RootComponent), js engine: hermes

Reproducer

https://www.notyet.com

Screenshots and Videos

No response

JoshuaSkootsky avatar Feb 14 '24 19:02 JoshuaSkootsky

:warning: Newer Version of React Native is Available!
:information_source: You are on a supported minor version, but it looks like there's a newer patch available - 0.72.10. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.

github-actions[bot] avatar Feb 14 '24 19:02 github-actions[bot]

:warning: Missing Reproducible Example
:information_source: We could not detect a reproducible example in your issue report. Please provide either:
  • If your bug is UI related: a Snack
  • If your bug is build/update related: use our Reproducer Template. A reproducer needs to be in a GitHub repository under your username.

github-actions[bot] avatar Feb 14 '24 19:02 github-actions[bot]

diff --git a/node_modules/react-native/Libraries/Lists/FlatList.js b/node_modules/react-native/Libraries/Lists/FlatList.js
index ddb929e..a4df5d8 100644
--- a/node_modules/react-native/Libraries/Lists/FlatList.js
+++ b/node_modules/react-native/Libraries/Lists/FlatList.js
@@ -420,6 +420,7 @@ class FlatList<ItemT> extends React.PureComponent<Props<ItemT>, void> {
 
   constructor(props: Props<ItemT>) {
     super(props);
+    this.props = props;
     this._checkProps(this.props);
     if (this.props.viewabilityConfigCallbackPairs) {
       this._virtualizedListPairs =
       ```

JoshuaSkootsky avatar Feb 14 '24 19:02 JoshuaSkootsky

@JoshuaSkootsky have you fixed this?

jsantos808 avatar Feb 20 '24 07:02 jsantos808

Fixed here Issue duplicated: https://github.com/facebook/react-native/issues/36828 https://github.com/facebook/react-native/issues/42623 https://github.com/facebook/react-native/issues/34783

dieguezz avatar Feb 28 '24 18:02 dieguezz

Thanks! @dieguezz) https://github.com/facebook/react-native/commit/e33767a36daf7901cb46854b6612dd52b0dbdeec

JoshuaSkootsky avatar Feb 29 '24 18:02 JoshuaSkootsky