Error happens because of this line: https://github.com/react-ga/react-ga/blob/master/types/index.d.ts#L74.
I think you must add @types/react as a (peer or normal) dependency and than add import * as React from 'react'; or so to your index.d.ts.
Can you do a PR for this? I don't actively use TS so I rely on PR's for this.
I believe this involves either generating declaration file programmatically to incorporate needed React types, which requires some setup changes, or setting @types/react as a peerDependency, which is bad for non-typescript users.
Maybe a good first step is to add a typescript section to the getting started docs and specifying that npm i @types/react is required
I see that this line has been added:
import * as React from 'react';
I can see this in the master branch at /types/index.d.ts but when I download the module I don't see this change. Can you please draft a new release with this change. I'm trying to use this in a Typescript React application. Thanks a lo!
npm install @types/react worked for me. Thanks @donaldpipowitch
Most helpful comment
I see that this line has been added:
I can see this in the master branch at /types/index.d.ts but when I download the module I don't see this change. Can you please draft a new release with this change. I'm trying to use this in a Typescript React application. Thanks a lo!