DefinitelyTyped/types/react-document-title/index.d.ts
Michael Rochlin 31dadd46f9
Add typing for children of react-document-title (#43022)
* Add typing for children of react-document-title

react-document-title uses React.Children.only to get the only child, and raises an error if more than one child is passed.

https://github.com/gaearon/react-document-title/blob/master/index.js#L31

* Add a test case with a child

* Turns out it should be React.ReactChild

Turns out it should be React.ReactChild

* Fix typo
2020-03-22 14:28:19 -07:00

18 lines
512 B
TypeScript

// Type definitions for react-document-title 2.0
// Project: https://github.com/gaearon/react-document-title
// Definitions by: Cleve Littlefield <https://github.com/cleverguy25>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
import * as React from 'react';
interface DocumentTitleProps {
title: string;
children?: React.ReactChild | null;
}
declare class DocumentTitle extends React.Component<DocumentTitleProps, any> {
}
export default DocumentTitle;