wix / react-native-ui-lib

UI Components Library for React Native
https://wix.github.io/react-native-ui-lib/
MIT License
6.53k stars 712 forks source link

SkeletonView causing react issue #2659

Closed amirping closed 1 year ago

amirping commented 1 year ago

Description

Using the SkeletonView after upgrade to Rn 0.71 & react 18 cause an error in terminal (app not crashing)

Related to

Actual behavior

Warning: Internal React error: Attempted to capture a commit phase error inside a detached tree. This indicates a bug in React. Likely causes include deleting the same fiber more than once, committing an already-finished tree, or an inconsistent return pointer.

Error message:

TypeError: undefined is not a function
    in Unknown (created by SkeletonView)
    in RCTView (created by View)
    in View (created by BasedShimmerPlaceholder)
    in RCTView (created by View)
    in View (created by BasedShimmerPlaceholder)
    in BasedShimmerPlaceholder (created by ShimmerPlaceholder)
    in ShimmerPlaceholder
    in Unknown (created by SkeletonView)
    in RCTView (created by View)
    in View
    in View (created by SkeletonView)
    in RCTView (created by View)
    in View (created by AnimatedComponent)
    in AnimatedComponent
    in AnimatedComponentWrapper (created by SkeletonView)

More Info

Code snippet

<SkeletonView
          width={width / 3 - 20}
          height={100}
          showContent={!isLoading}
          renderContent={() => (
            <View>
              {home_categories?.map((homeCategory: any, index:number) => (
                <HomeCategorie
                  item={homeCategory}
                  key={`home_category_${index}`}
                  headingTo={() => goToSubCategories(homeCategory)}
                />
              ))}
            </View>
          )}
          accessibilityLabel={'Loading categories'}
          times={1}
        />

Environment

Affected platforms

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.