meliorence / meliorence/react-native-snap-carousel

Is it possible to put Carousel inside GiftedChat

Open
#689 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
10.5k
Forks
2.3k
PR merge metrics
No merged PRs in 30d

Description

Is this a bug report, a feature request, or a question?

I am using:
"react-native-gifted-chat": "^0.13.0",
"react-native-snap-carousel": "^3.8.4",

Is it possible to use carousel component inside gifted-chat?

If I try to place carousel inside a custom message bubble, I am getting these warnings:

  1. "Warning: Failed prop type: The prop renderItem is marked as required in Carousel, but its value is undefined."
  2. If I live reload/refresh the app, I get:
    image

Code:

<View style={{ flex: 1, flexDirection: 'row', justifyContent: 'center', }}>
  <Carousel
    ref={ref => this.carousel = ref}
    layout={'default'}
    data={[{title: "Item 1", text: "Text 1" }, { title: "Item 2",  text: "Text 2" }]}
    renderItem={this.renderCarCard}
    sliderWidth={WIDTH}
    itemWidth={WIDTH}
    slideStyle={{ paddingHorizontal: 20 }}
  />
</View>
  renderCarCard = ({ item, index }) => {
    return (
      <View>
        <Text style={{ color: 'white' }}>{item.text}</Text>
      </View>
    );
  }

p.s. If it helps, horizontal scrollView works inside of the giftedChat

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Use the supplied react-native-gifted-chat and react-native-snap-carousel versions to reproduce the custom-message-bubble case, including the renderItem warning after refresh. The report does not define a project change or expected result, so clarify whether supported integration or a library change is wanted before estimating completion.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react-native
Domain
mobile-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.