react-helmet-async icon indicating copy to clipboard operation
react-helmet-async copied to clipboard

Typescript types out of sync

Open patricknick opened this issue 7 years ago • 4 comments

The types of react-helmet have been updated and now there is no default export anymore. Check out this PR: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/38557/files

The PR updates also the @types/react-helmet-async package. But as it turns out, react-helmet-async includes its own types, which relies on the old version of react-helmet. (It imports the default export.) Therefore in the code an error is shown as JSX element type 'Helmet' does not have any construct or call signatures..

Why is there a d.ts file in this repo and in DefinitelyTyped? Should I file a PR for this repo?

patricknick avatar Sep 27 '19 11:09 patricknick

The fix is to change

import Helmet, { HelmetData } from 'react-helmet';

to

import { Helmet, HelmetData } from 'react-helmet';

Would be great if this could be patched in this repo.

davidje13 avatar Sep 28 '19 20:09 davidje13

I've commented on the PR, but will start the convo here.

When we came up with this issue we simply ran npm update. My bad was, that I've overlooked that fakt that we had @types for react-helmet as well as react-helmet-async in our package.json. Simply, because the codebase is so huge – Sorry! After removing both @types everything compiled perfectly again.

Don't have the time to see if some dependencies have bin pinned or anything. Any ideas?

bke-daniel avatar Oct 07 '19 16:10 bke-daniel

I have the same issue using "react-helmet-async": "^1.0.3" and @types/react-helmet-async": "^0.0.3".

I'm getting this error : JSX element type 'Helmet' does not have any construct or call signatures.ts(2604)

I'm using yarn BTW

ghost avatar Oct 08 '19 09:10 ghost

should be sorted after #83 & #95

https://www.npmjs.com/package/react-helmet-async/v/1.0.6

staylor avatar May 01 '20 19:05 staylor