Stuck with react native redash library

Viewed 1209

I get stuck with react-native-redash library when coding (Instagram Pinch-to-Zoom). I can not use Vector (or vec) and onGestureEvent from react-native-redash such as in this Video. Because there is no implementation for them (vec just have "create function" and does not have "set function")

Does anybody know what problem is? I have used Typescript for my project. And I have read v1 Users notice in redash docs but don't know which circumstance to apply it. Thank in advance.

Library I used in my project:

"react-native-reanimated": "~1.7.0"

"react-native-redash": "^15.6.0"

"react-native-gesture-handler": "~1.6.0"

"react-native": "0.61.4"

1 Answers

I get answer after doing some steps below:

  • Add this line "include": ["node_modules/react-native-redash/lib/typescript/v1/index.d.ts"] to tsconfig.
  • Import any function / variable you need from v1 docs. For example, you want to add 'onGestureEvent' function: import {onGestureEvent} from "react-native-redash/lib/module/v1";

But I get some new problems with tsconfig such as alias setup for some paths is alerted with red underline and code suggestion is not working with function/ variable from this "react-native-redash/lib/module/v1".

Related