Skip to content

Commit

Permalink
🤖 Merge PR DefinitelyTyped#46509 update(react-helmet): 6.1 ES exports…
Browse files Browse the repository at this point in the history
… changes by @peterblazejewicz

This commit updates definition by:
- adding support for 6.1 change introducing named and default exports
  support (this fixes errorrs like ` JSX element type 'Helmet' does not
  have any construct or call signatures.`
- minor version bump
- maintainer added

nfl/react-helmet#547
https://github.com/nfl/react-helmet/releases/tag/6.1.0

Thanks!
  • Loading branch information
peterblazejewicz authored and danielrearden committed Sep 22, 2020
1 parent bdea498 commit f89b5cc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
10 changes: 8 additions & 2 deletions types/react-helmet/index.d.ts
@@ -1,4 +1,4 @@
// Type definitions for react-helmet 6.0
// Type definitions for react-helmet 6.1
// Project: https://github.com/nfl/react-helmet
// Definitions by: Evan Bremer <https://github.com/evanbb>
// Isman Usoh <https://github.com/isman-usoh>
Expand All @@ -8,6 +8,7 @@
// Yamagishi Kazutoshi <https://github.com/ykzts>
// Justin Hall <https://github.com/wKovacs64>
// Andriy2 <https://github.com/Andriy2>
// Piotr Błażejewicz <https://github.com/peterblazejewicz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8

Expand Down Expand Up @@ -53,13 +54,18 @@ export interface HelmetProps {
titleTemplate?: string;
}

export class Helmet extends React.Component<HelmetProps> {
declare class Helmet extends React.Component<HelmetProps> {
static peek(): HelmetData;
static rewind(): HelmetData;
static renderStatic(): HelmetData;
static canUseDOM: boolean;
}

declare const HelmetExport: typeof Helmet;

export { HelmetExport as Helmet };
export default HelmetExport;

export interface HelmetData {
base: HelmetDatum;
bodyAttributes: HelmetHTMLBodyDatum;
Expand Down
3 changes: 2 additions & 1 deletion types/react-helmet/react-helmet-tests.tsx
@@ -1,5 +1,6 @@
import * as React from "react";
import { Helmet, HelmetData } from "react-helmet";
import { Helmet as HelmedNamedExport, HelmetData } from "react-helmet";
import Helmet from 'react-helmet';

const Application = () =>
<div className="application">
Expand Down

0 comments on commit f89b5cc

Please sign in to comment.