This was surprisingly annoying to figure out.
I used this Google API documentation for vanilla JS, but it was a lot more trouble than I expected to get it working in a TypeScript React project.
Long story short, you need to install:
- gapi-script
- @types/gapi
- types/gapi.auth2
For some architectural reason it seems the gapi npm package can't just be import
ed into the .tsx file.
React can't find a declaration module for gapi-script, after i imported gapi in the component, and having installed those 3 packages that you have written.
Any solution for this ?