Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SkeletonView: LinearGradient warning due to mismatched colors and locations arrays #3484

Open
3 of 7 tasks
wasimkham opened this issue Jan 16, 2025 · 0 comments
Open
3 of 7 tasks
Labels
bug a bug in one of the components

Comments

@wasimkham
Copy link

Description

When using the SkeletonView component, there's a persistent warning from the underlying react-native-shimmer-placeholder package about mismatched array lengths between colors and locations in the LinearGradient. This warning appears in the native bridge layer and cannot be suppressed using standard React Native LogBox methods.

Related to

  • Components
  • Demo
  • Docs
  • Typings

Steps to reproduce

  1. Use SkeletonView component in any screen
NOBRIDGE) WARN LinearGradient colors and locations props should be arrays of the same length

Expected behavior

The SkeletonView should either:

  • Allow controlling the locations prop to match custom color arrays
  • Ensure internal implementation maintains matching array lengths
  • Not produce warnings about mismatched array lengths

Actual behavior

Persistent warnings appear in the console because the internal implementation of react-native-shimmer-placeholder uses a fixed locations array [0.3, 0.5, 0.7] (length: 3) but doesn't enforce or expose control over matching the colors array length.

More Info

Code snippet

tsx
import { SkeletonView } from 'react-native-ui-lib';
// Basic usage that still triggers the warning
function LoadingState() {
return (
<SkeletonView
template={SkeletonView.templates.LIST_ITEM}
showContent={false}
// Even with custom colors, no way to control locations
colors={['#ebebeb', '#c5c5c5', '#ebebeb']}
/>
);
}

Screenshots/Video

Image Image

Environment

  • React Native version: "react-native": "0.76.5"
  • Expo version: "expo": "~52.0.19"
  • React Native UI Lib version: "react-native-ui-lib": "^7.34.6"

Affected platforms

  • Android
  • iOS
  • Web
@wasimkham wasimkham added the bug a bug in one of the components label Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug a bug in one of the components
Projects
None yet
Development

No branches or pull requests

1 participant