Skip to content

Crash when use customAnimation #867

@khanwilson

Description

@khanwilson

Describe the bug
here is the code:

const renderItem = useCallback(({ item }: { item: IDayData; index: number }) => {
    return <View style={{ width: windowWidth * 0.9, height: 500, backgroundColor: 'red' }} />;
  }, [])

<Carousel
      vertical={true}
      width={windowWidth * 0.9}
      height={500}
      customAnimation={(value: number) => {
        'worklet';
        const zIndex = interpolate(
          value,
          [-3, -2, -1, 0, 1, 2, 3],
          [0, 1, 3, 5, 3, 1, 0],
          Extrapolation.CLAMP,
        );

        return {
          // ...animatedTransform,
          zIndex,
        } as any;
      }}
      modeConfig={{
        parallaxScrollingScale: 0.9,
        parallaxScrollingOffset: 50,
      }}
      data={data}
      renderItem={renderItem}
    />

To Reproduce
Yesterday, my component still running well. But today it just gonna die when scrolling. Just crash without log anything.
i findout it crash because customAnimation, when i comment it can run.

Someone can help...

Versions
"@expo/vector-icons": "^15.0.3",
"@legendapp/list": "^2.0.14",
"@react-native-async-storage/async-storage": "^2.2.0",
"@react-navigation/bottom-tabs": "^7.4.0",
"@react-navigation/elements": "^2.6.3",
"@react-navigation/native": "^7.1.8",
"@react-three/drei": "^10.7.7",
"@react-three/fiber": "^9.4.0",
"@types/qs": "^6.14.0",
"axios": "^1.13.2",
"expo": "~54.0.25",
"expo-asset": "~12.0.10",
"expo-clipboard": "^8.0.7",
"expo-constants": "~18.0.10",
"expo-font": "~14.0.9",
"expo-gl": "^16.0.7",
"expo-haptics": "~15.0.7",
"expo-image": "~3.0.10",
"expo-linear-gradient": "^15.0.7",
"expo-linking": "~8.0.9",
"expo-router": "~6.0.15",
"expo-splash-screen": "~31.0.11",
"expo-status-bar": "~3.0.8",
"expo-symbols": "~1.0.7",
"expo-system-ui": "~6.0.8",
"expo-three": "^8.0.0",
"expo-web-browser": "~15.0.9",
"i18next": "^25.6.2",
"lottie-react-native": "^7.3.4",
"qs": "^6.14.0",
"react": "19.1.0",
"react-dom": "19.1.0",
"react-i18next": "^16.3.1",
"react-native": "0.81.5",
"react-native-gesture-handler": "~2.28.0",
"react-native-reanimated": "~4.1.1",
"react-native-reanimated-carousel": "^4.0.3",
"react-native-safe-area-context": "~5.6.0",
"react-native-screens": "~4.16.0",
"react-native-svg": "15.12.1",
"react-native-web": "~0.21.0",
"react-native-worklets": "0.5.1",
"three": "^0.181.0",
"zustand": "^5.0.8"

Smartphone:

  • Device: simulator and real device 15prm
  • OS: 18.5

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingquestionFurther information is requested

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions