Skip to content

Hanging Skeleton animation reference #2930

Open
@ealmiladi

Description

@ealmiladi

Description

Skeleton leaves animations hanging in the background

CodeSandbox/Snack link

None

Steps to reproduce

if (!isLoaded) {
    Animated.loop(pulse).start()
    return (
      <Animated.View
        style={{ opacity: pulseAnim }}
        className={`${startColor} ${skeletonStyle({
          variant,
          class: className,
        })}`}
        {...props}
        ref={ref}
      />
    )
  } else {
    Animated.loop(pulse).stop()

    return children
  }

It's possible that the Skeleton component is used conditionally; for example:
{showSkeleton && <Skeleton/>}

With how the current implementation is written, the Animation loop would start, but never actually stop, because the component unmounted. This leaves a hanging animation reference, causing downstream issues (this impacted e2e, as Detox constantly waited for the animation to complete, but would never).

gluestack-ui Version

2

Platform

  • Expo
  • React Native CLI
  • Next
  • Web
  • Android
  • iOS

Other Platform

No response

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions