Carousel does not re-render when data changes

:warning: Before you continue


Before submitting a bug report, please review our troubleshooting documentation at https://developer.amazon.com/docs/kepler-tv/troubleshoot-overview.html.

If you still want to file a bug report, please make sure to fill in all the details below and provide the necessary information.

NOTE: PLEASE ONLY REPORT A SINGLE BUG USING THIS TEMPLATE.
If you’re experiencing multiple issues, please file a separate report for each.


:backhand_index_pointing_right: Bug Description


1. Summary

Native Carousel component does not update when data changes.

App Name:
App Link on Amazon Appstore (found through Developer Console → Actions column in App List → View on Amazon.com):

Bug Severity
Select one that applies

  • Impacts operation of app
  • Blocks current development
  • Improvement suggestion
  • Issue with documentation (If selected, please share the doc link and describe the issue)
  • Other

2. Steps to Reproduce

  1. Fill native Carousel with data (list)
  2. Modify the data but keep using the same id for each item

3. Observed Behavior

Explain what actually happened, noting any discrepancies or malfunctions.

Carousel does not render new data

4. Expected Behavior

Describe what you expected the SDK to do under normal operation.

Carousel should render new data

4.a Possible Root Cause & Temporary Workaround

Fill out anything you have tried. If you don’t know, N/A is acceptable

Workaround is to define a custom keyProvider, but in order to do this, all pieces of data that changed must be included in the key for each carousel item.

5. Logs or crash report

(Please make sure to provide relevant logs as attachment and share VPKG file with your Amazon contact)

For crash issues, please refer this guide for faster troubleshooting: https://developer.amazon.com/docs/kepler-tv/detect-crash.html.

  • App/Device Logs
  • Crash Logs
  • Crash Report
  • For issues with Kepler Studio Extension, please share log files from below folders:
     ~/.vscode/extensions/amazon.kepler-extension-<version>/ExtensionLogs
     ~/.vscode/extensions/amazon.kepler-ui-extension-<version>/ExtensionLogs
    

6. Environment

Please fill out the fields related to your bug below:

  • SDK Version: 0.20.2975
  • App State: Foreground
  • OS Information
    Please ssh into the device via kepler exec vda shelland copy the output from cat /etc/os-releaseinto the answer section below. Note, if you don’t have a simulator running or device attached kepler exec vda shell will respond with vda: no devices/emulators found
NAME="OS"
OE_VERSION="4.0.0"
OS_MAJOR_VERSION="1"
OS_MINOR_VERSION="1"
RELEASE_ID="2"
OS_VERSION="1.1"
BRANCH_CODE="VegaMainlineTvIntegration"
BUILD_DESC="OS 1.1 (VegaMainlineTvIntegration/4398)"
BUILD_FINGERPRINT="4.0.138086.0(3072cab629675a74)/4398N:user-external/release-keys"
BUILD_VARIANT="user-external"
BUILD_TAGS="release-keys"
BUILD_DATE="Fri Jul 25 09:06:08 UTC 2025"
BUILD_TIMESTAMP="1753434368"
VERSION_NUMBER="201010439850"

7. Example Code Snippet / Screenshots / Screengrabs

Include any relevant code or component setup in React Native that can help reproduce the bug.

import { useCallback, useMemo, useState } from 'react'
import {
  Pressable,
  StyleSheet,
  Text,
  View,
  type ListRenderItemInfo,
} from 'react-native'
import { Button, Carousel } from '@amzn/kepler-ui-components'

type CardProps = {
  title: string
  description: string
  isFavorite: boolean
}

type CardData = CardProps & {
  id: number
}

const INITIAL_DATA: CardData[] = [
  {
    id: 10001,
    title: 'Title 1',
    description: 'A description of the content',
    isFavorite: true,
  },
  {
    id: 10002,
    title: 'Title 2',
    description: 'ocer aliquam vergo',
    isFavorite: false,
  },
  {
    id: 10003,
    title: 'Title 3',
    description: 'textus abeo dicta',
    isFavorite: false,
  },
  {
    id: 10004,
    title: 'Title 4',
    description: 'admiratio calculus curtus',
    isFavorite: false,
  },
  {
    id: 10005,
    title: 'Title 5',
    description: 'tondeo sto commemoro',
    isFavorite: false,
  },
]

const extractKey = <T extends CardData>(item: T, index: number) =>
  `${item.id}-${index}`

const Card = (props: CardProps) => {
  const { title, description, isFavorite } = props
  const [isFocused, setFocus] = useState<boolean>(false)
  return (
    <Pressable
      style={[styles.card, isFocused ? styles.focusedCard : null]}
      onBlur={() => setFocus(false)}
      onFocus={() => setFocus(true)}
    >
      <View style={styles.metadata}>
        <Text style={styles.text}>{title}</Text>
        <Text style={styles.text}>{description}</Text>
      </View>
      {isFavorite ? <Text style={styles.text}>💗</Text> : null}
    </Pressable>
  )
}

const ViewComp = () => undefined

const renderItem = ({ item }: ListRenderItemInfo<CardData>) => (
  <Card
    key={item.id}
    title={item.title}
    description={item.description}
    isFavorite={item.isFavorite}
  />
)

const CarouselStory = () => {
  const [data, setData] = useState(INITIAL_DATA)
  const [favoriteIndex, setFavoriteIndex] = useState(0)

  const updateFavorite = useCallback(
    (newFavoriteIndex: number) => {
      if (newFavoriteIndex >= 0 && newFavoriteIndex < data.length) {
        setData(
          data.map((d, i) => ({
            ...d,
            isFavorite: i === newFavoriteIndex,
          })),
        )
        setFavoriteIndex(newFavoriteIndex)
      }
    },
    [data],
  )

  const itemDimensions = useMemo(
    () => [
      {
        view: ViewComp,
        dimension: { width: CARD_WIDTH, height: CARD_HEIGHT },
      },
    ],
    [],
  )

  const getItemForIndex = useMemo(() => (_idx: number) => ViewComp, [])

  return (
    <View style={styles.container}>
      <View style={styles.settings}>
        <Button
          label="<"
          onPress={() => updateFavorite(favoriteIndex - 1)}
          variant="primary"
        />
        <Text style={styles.text}>{favoriteIndex}</Text>
        <Button
          label=">"
          onPress={() => updateFavorite(favoriteIndex + 1)}
          variant="primary"
        />
      </View>
      {/* Do they have extraData like FlatList has? */}
      <Carousel
        orientation="horizontal"
        data={data}
        itemDimensions={itemDimensions}
        keyProvider={extractKey}
        renderItem={renderItem as any}
        getItemForIndex={getItemForIndex}
      />
    </View>
  )
}

const CARD_WIDTH = 300
const CARD_HEIGHT = 200

const styles = StyleSheet.create({
  container: {
    backgroundColor: 'black',
    flexDirection: 'column',
    gap: 16,
  },
  settings: {
    display: 'flex',
    flexDirection: 'row',
    alignItems: 'center',
    gap: 16,
  },
  card: {
    display: 'flex',
    flexDirection: 'column',
    justifyContent: 'space-between',
    alignItems: 'center',
    backgroundColor: '#333333',
    borderRadius: 8,
    borderWidth: 2,
    width: CARD_WIDTH,
    height: CARD_HEIGHT,
    padding: 10,
  },
  focusedCard: {
    borderStyle: 'solid',
    borderWidth: 2,
    borderColor: '#cccccc',
  },
  metadata: {
    display: 'flex',
    flexDirection: 'column',
    gap: 8,
  },
  text: {
    color: 'white',
    fontSize: 30,
  },
})

export default CarouselStory

:backhand_index_pointing_right: Playback Issues


If this is a playback issue, please provide your VPKG and/or content URL, any pre-conditions (like geo-location) [Share privately with your Amazon contact] , and let us know if it’s x86 or arm7.


<!-- Describe your playback issue if applicable -->

Please share the following details in addition:_

  • Player SDK: [Bitmovin, Shaka, ...]
  • Player SDK Version: [e.g. 1.23]
    • Audio Codecs: [AAC, ...]
    • Video Codecs: [h.264, mp4]
    • Manifest Types: [m3u8, dash, etc ..]

Q: Would you like to be contacted to share your latest VPKG compiled with latest SDK:

N

Q: VPN or Login needed to verify functionality in VPKG?

N

Q: If applicable, please provide your media/content url
If this is created dynamically, tokenized, etc please provide a way for us to access it

N/A

Q: Are there any special headers required to reproduce the issue you are facing?

N/A

Additionally please provide the following if possible
Provide Screenshots / Screengrabs / Logs. Please include as much information as you can that will help debug.

<!-- Answer here if applicable --> 

:backhand_index_pointing_right: Additional Context


Any Additional Context you would like to provide?
Add any other relevant information, such as recent updates to the SDK, dependencies, or device OS that may affect the bug.

This is a simplified example.  We have other fields that also can get updated in the data (list) that do not cause new ids to be generated.  Another way to force Carousel to re-render items would be helpful, such as how FlatList has the extraData prop.

Hi @cspadanuta,

Thanks for reaching out! Our team will investigate and get back.