React-ga: Issue in v2.5.0

Created on 23 Apr 2018  路  3Comments  路  Source: react-ga/react-ga

error

I got the error after upgraded to 2.5.0.

I imported import * as ReactGA from "react-ga";. It worked in 2.4.1, but not in 2.5.0. Any idea?

Most helpful comment

I've added a PR to fix that.

All 3 comments

The error looks to be caused by the same thing I'm seeing.
If so, I think we can change the issue title to be a bit more specific.

node_modules/react-ga/types/index.d.ts(8,8): error TS1192: Module '"/node_modules/@types/react/index"' has no default export.

In the recent release, import React from 'react'; should be import * as React from 'react';

I've added a PR to fix that.

Nice one @dsole
In the meantime, a workaround that did it for me is popping this in your tsconfig.json

    "allowSyntheticDefaultImports": true

Not the best idea in the world, but yeah

Was this page helpful?
0 / 5 - 0 ratings