meliorence / meliorence/react-native-snap-carousel

All args to renderItem should be optional

Open
#762 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

renderItem: (
    baseData: { index: number; dataIndex: number; item: TData },
    parallaxData: {
      scrollPosition: Animated.Value | undefined,
      carouselRef: ScrollView | FlatList<TData> | null,
      vertical: false,
      itemWidth: number,
      sliderWidth: number,
    }
  )

All the arguments into renderItem should be optional...in theory you could do just

const renderitem = useCallback(() => <Text>Foo Bar</Text>, [])

right?

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

Review the renderItem signature shown in the issue and locate the surrounding React Native carousel typings. Verify whether a callback with no parameters type-checks, then add or update type coverage so the optional-argument behavior is confirmed.

Written by the indexing model from the issue text.

Assessment

Tech stack
react-native, typescript
Domain
mobile
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.