react-google-calendar-api icon indicating copy to clipboard operation
react-google-calendar-api copied to clipboard

ApiCalendar any type

Open Hjkun77 opened this issue 6 years ago • 9 comments

Variable 'ApiCalendar' implicitly has type 'any' in some locations where its type cannot be determined.ts(7034)

Hjkun77 avatar Nov 21 '20 15:11 Hjkun77

same here

pedrorossato avatar Dec 02 '20 03:12 pedrorossato

What is your import?

Kubessandra avatar Dec 03 '20 13:12 Kubessandra

The one stated in the README.md for typescript @Kubessandra

Hjkun77 avatar Dec 03 '20 13:12 Hjkun77

If you try adding .ts for the extension of the import does it work?

Kubessandra avatar Dec 03 '20 13:12 Kubessandra

If you try adding .ts for the extension of the import does it work? You mean import ApiCalendar from 'react-google-calendar-api/src/ApiCalendar.ts';? If so, doesn't work...

pedrorossato avatar Dec 04 '20 13:12 pedrorossato

Yep adding .ts doesn't work as well.

The types any in the dependency is throwing an error.

Hjkun77 avatar Dec 04 '20 13:12 Hjkun77

Yep adding .ts doesn't work as well.

The types any in the dependency is throwing an error.

Yes It's not working....

kaiserkaran018 avatar Feb 18 '21 16:02 kaiserkaran018

Screenshot 2022-04-20 at 12 13 02 PM

This is the compile error received:

Compiled with problems:X

ERROR in node_modules/react-google-calendar-api/src/ApiCalendar.ts:44:24

TS7015: Element implicitly has an 'any' type because index expression is not of type 'number'. 42 | */ 43 | private initClient(): void {

44 | this.gapi = window['gapi']; | ^^^^^^ 45 | this.gapi.client 46 | .init(Config) 47 | .then(() => {

ERROR in node_modules/react-google-calendar-api/src/ApiCalendar.ts:70:24

TS7015: Element implicitly has an 'any' type because index expression is not of type 'number'. 68 | */ 69 | private handleClientLoad(): void {

70 | this.gapi = window['gapi']; | ^^^^^^ 71 | const script = document.createElement('script'); 72 | script.src = 'https://apis.google.com/js/api.js'; 73 | document.body.appendChild(script);

ERROR in node_modules/react-google-calendar-api/src/ApiCalendar.ts:75:14

TS7015: Element implicitly has an 'any' type because index expression is not of type 'number'. 73 | document.body.appendChild(script); 74 | script.onload = (): void => {

75 | window['gapi'].load('client:auth2', this.initClient); | ^^^^^^ 76 | }; 77 | } 78 |

ravishwetha avatar Apr 20 '22 04:04 ravishwetha

Hi, This has been fixed commit version [> 2.0.x]

This include a lot of changes if you have any feedbacks / questions do not hesitate

Kubessandra avatar May 29 '22 15:05 Kubessandra