react-helmet: add link and meta prop types (#31802)

* Add missing semicolon

* Add link and meta prop types
This commit is contained in:
Oliver Joseph Ash
2018-12-31 10:43:36 -08:00
committed by Sheetal Nandi
parent b081a5b7d0
commit a0f4fe7299
2 changed files with 12 additions and 3 deletions
+6 -2
View File
@@ -6,6 +6,10 @@
import * as React from "react";
type LinkProps = JSX.IntrinsicElements['link'];
type MetaProps = JSX.IntrinsicElements['meta'];
export interface HelmetProps {
async?: boolean;
base?: any;
@@ -15,8 +19,8 @@ export interface HelmetProps {
encodeSpecialCharacters?: boolean;
htmlAttributes?: any;
onChangeClientState?: (newState: any) => void;
link?: Array<any>;
meta?: Array<any>;
link?: LinkProps[];
meta?: MetaProps[];
noscript?: Array<any>;
script?: Array<any>;
style?: Array<any>;
+6 -1
View File
@@ -101,4 +101,9 @@ function HTML() {
font-size: 12px;
}
`}</style>
</Helmet>
</Helmet>;
// $ExpectError
<Helmet link={[ invalidProp: 'foo' ]} />;
// $ExpectError
<Helmet meta={[ invalidProp: 'foo' ]} />;