meliorence / meliorence/react-native-snap-carousel

Property 'maxToRenderPerBatch' does not exist on type [React-Native + Typescript]

Open
#424 5 comments 2 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

Hello, i have a project where i use React-Native + typescript. When I use properties maxToRenderPerBatch or initialNumToRender i have the following error when I compile my ts files into js

 Property 'maxToRenderPerBatch' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<Carousel<Event>> & Readonly<{ children?: ReactNode; }> & Readonly<CarouselProperties<Event>>'

Also these properties doesn't exist in @types/react-native-snap-carousel/index.d.ts

Environment
React: 16.5.0
React native: 0.57.2
react-native-snap-carousel: 3.7.5
typescript: 3.13.
types/react-native-snap-carousel": 3.7.1

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

Start with @types/react-native-snap-carousel/index.d.ts and inspect the CarouselProperties definition for maxToRenderPerBatch and initialNumToRender. Update the declarations so the reported React Native props are accepted, then verify that the example TypeScript usage compiles without the property errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
react-native, typescript
Domain
mobile
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.