Skip to content

Commit a8499f8

Browse files
authored
Update TS to 4.1.3 & add strict checks (software-mansion#1592)
1 parent 4267851 commit a8499f8

File tree

4 files changed

+22
-11
lines changed

4 files changed

+22
-11
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
"react-native-gesture-handler": "^1.6.1",
9191
"react-test-renderer": "16.9.0",
9292
"release-it": "^13.1.1",
93-
"typescript": "^3.9.7"
93+
"typescript": "^4.1.3"
9494
},
9595
"lint-staged": {
9696
"*.js": [

react-native-reanimated-tests.tsx

+15-6
Original file line numberDiff line numberDiff line change
@@ -335,11 +335,14 @@ function CancelAnimationTest() {
335335
// withDelay
336336
function WithDelayTest() {
337337
const x = useSharedValue(0);
338-
const gestureHandler = useAnimatedGestureHandler({
338+
const gestureHandler = useAnimatedGestureHandler<
339+
PanGestureHandlerGestureEvent,
340+
{ startX: number }
341+
>({
339342
onStart: (_, _ctx) => {
340343
cancelAnimation(x);
341344
},
342-
onActive: (event, ctx: { startX: number }) => {
345+
onActive: (event, ctx) => {
343346
x.value = ctx.startX + event.translationX;
344347
},
345348
onEnd: (_) => {
@@ -365,11 +368,14 @@ function WithDelayTest() {
365368
// withRepeat
366369
function WithRepeatTest() {
367370
const x = useSharedValue(0);
368-
const gestureHandler = useAnimatedGestureHandler({
371+
const gestureHandler = useAnimatedGestureHandler<
372+
PanGestureHandlerGestureEvent,
373+
{ startX: number }
374+
>({
369375
onStart: (_, _ctx) => {
370376
cancelAnimation(x);
371377
},
372-
onActive: (event, ctx: { startX: number }) => {
378+
onActive: (event, ctx) => {
373379
x.value = ctx.startX + event.translationX;
374380
},
375381
onEnd: (_) => {
@@ -395,11 +401,14 @@ function WithRepeatTest() {
395401
// withSequence
396402
function WithSequenceTest() {
397403
const x = useSharedValue(0);
398-
const gestureHandler = useAnimatedGestureHandler({
404+
const gestureHandler = useAnimatedGestureHandler<
405+
PanGestureHandlerGestureEvent,
406+
{ startX: number }
407+
>({
399408
onStart: (_, _ctx) => {
400409
cancelAnimation(x);
401410
},
402-
onActive: (event, ctx: { startX: number }) => {
411+
onActive: (event, ctx) => {
403412
x.value = ctx.startX + event.translationX;
404413
},
405414
onEnd: (_) => {

tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"allowSyntheticDefaultImports": true,
99
"moduleResolution": "node",
1010
"lib": ["es6"],
11-
"esModuleInterop": true
11+
"esModuleInterop": true,
12+
"strict": true
1213
},
1314
"files": ["react-native-reanimated-tests.tsx", "react-native-reanimated.d.ts"]
1415
}

yarn.lock

+4-3
Original file line numberDiff line numberDiff line change
@@ -9015,9 +9015,10 @@ typedarray@^0.0.6:
90159015
version "0.0.6"
90169016
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
90179017

9018-
typescript@^3.9.7:
9019-
version "3.9.7"
9020-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.7.tgz#98d600a5ebdc38f40cb277522f12dc800e9e25fa"
9018+
typescript@^4.1.3:
9019+
version "4.1.3"
9020+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.1.3.tgz#519d582bd94cba0cf8934c7d8e8467e473f53bb7"
9021+
integrity sha512-B3ZIOf1IKeH2ixgHhj6la6xdwR9QrLC5d1VKeCSY4tvkqhF2eqd9O7txNlS0PO3GrBAFIdr3L1ndNwteUbZLYg==
90219022

90229023
ua-parser-js@^0.7.18:
90239024
version "0.7.18"

0 commit comments

Comments
 (0)