React-native-tab-view: Typescript issue

Created on 22 May 2020  路  5Comments  路  Source: satya164/react-native-tab-view

Can't get this working with typescript, it says:

node_modules/react-native-tab-view/lib/typescript/src/SceneMap.d.ts:4:8 - error TS2339: Property 'route' does not exist on type '{}'.

4 }): ({ route, jumpTo, position }: T) => JSX.Element;
         ~~~~~

node_modules/react-native-tab-view/lib/typescript/src/SceneMap.d.ts:4:15 - error TS2339: Property 'jumpTo' does not exist on type '{}'.

4 }): ({ route, jumpTo, position }: T) => JSX.Element;
                ~~~~~~

node_modules/react-native-tab-view/lib/typescript/src/SceneMap.d.ts:4:23 - error TS2339: Property 'position' does not exist on type '{}'.

4 }): ({ route, jumpTo, position }: T) => JSX.Element;
                        ~~~~~~~~

bug needs repro

All 5 comments

Got it too. The problem is here: https://github.com/react-native-community/react-native-tab-view/blob/master/src/SceneMap.tsx#L12 { route, jumpTo, position } should be present in parent of T

Hey! Thanks for opening the issue. Can you provide a minimal repro which demonstrates the issue? Posting a snippet of your code in the issue is useful, but it's not usually straightforward to run. A repro will help us debug the issue faster. Please try to keep the repro as small as possible. The easiest way to provide a repro is on snack.expo.io. If it's not possible to repro it on snack.expo.io, then you can also provide the repro in a GitHub repository.

repro:

git clone [email protected]:react-native-community/react-native-tab-view.git
npm ci
npm run typescript

Found 7 errors.

@punksta that's not how you setup this repo. anyway the op's issue seems to be with updated typescript.

I can confirm I've got the same issue ([email protected], [email protected]).

After bumping react-native-tab-view to 2.15.0, the errors were solved.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

t3chnoboy picture t3chnoboy  路  3Comments

itzsaga picture itzsaga  路  3Comments

ios-dev-newbie picture ios-dev-newbie  路  3Comments

satya164 picture satya164  路  3Comments

nastarfan picture nastarfan  路  3Comments