Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faulty TypeScript Types #56

Closed
nlindroos opened this issue Oct 9, 2020 · 3 comments
Closed

Faulty TypeScript Types #56

nlindroos opened this issue Oct 9, 2020 · 3 comments
Labels
bug Something isn't working mobile React Native

Comments

@nlindroos
Copy link

Hi!

"react-native-countdown-circle-timer": "2.3.9",

react-native-countdown-circle-timer/types/CountdownCircleTimer.d.ts contains the line

import { Config } from 'use-elapsed-time'

This presumably refers to the use-elapsed-time package. This package is not included as a dependency in react-native-countdown-circle-timer/package.json, which causes TypeScript to emit the error Cannot find module 'use-elapsed-time' or its corresponding type declarations. ts(2307).

@nlindroos
Copy link
Author

To make TypeScript compilation work, this can be temporarily bypassed with e.g. the following patch, using patch-package:

// patches/react-native-countdown-circle-timer+2.3.9.patch

diff --git a/node_modules/react-native-countdown-circle-timer/types/CountdownCircleTimer.d.ts b/node_modules/react-native-countdown-circle-timer/types/CountdownCircleTimer.d.ts
index ee7e758..e37afec 100644
--- a/node_modules/react-native-countdown-circle-timer/types/CountdownCircleTimer.d.ts
+++ b/node_modules/react-native-countdown-circle-timer/types/CountdownCircleTimer.d.ts
@@ -1,7 +1,4 @@
 import * as React from 'react'
-import { Config } from 'use-elapsed-time'
-
-export type OnComplete = Config['onComplete']
 
 export interface TimeProps {
   remainingTime?: number
@@ -48,7 +45,7 @@ export interface CountdownCircleTimerProps {
    * and second element "delay" specifies the delay before looping again in milliseconds.
    *
    */
-  onComplete?: OnComplete
+  onComplete?: any
   /** Aria label for the whole component. Default: "Countdown timer" */
   ariaLabel?: string
   /** Render prop function to customize the text message that will be read by the screen reader during the countdown */

@vydimitrov
Copy link
Owner

Hey @nlindroos, thanks for reporting this issue. It is now fixed in 2.3.10 👍

@vydimitrov vydimitrov added bug Something isn't working mobile React Native labels Oct 11, 2020
@nlindroos
Copy link
Author

Thank you @vydimitrov for the quick response and fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working mobile React Native
Projects
None yet
Development

No branches or pull requests

2 participants