mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* 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
21 lines
513 B
TypeScript
21 lines
513 B
TypeScript
import * as React from 'react';
|
|
import DocumentTitle from 'react-document-title';
|
|
|
|
class TitleTest extends React.Component<any, any> {
|
|
render() {
|
|
return <DocumentTitle title="Test" />;
|
|
}
|
|
}
|
|
|
|
class TitleTestOneChild extends React.Component<any, any> {
|
|
render() {
|
|
return <DocumentTitle title="Test">A Child</DocumentTitle>;
|
|
}
|
|
}
|
|
|
|
class TitleTestOneReactChild extends React.Component<any, any> {
|
|
render() {
|
|
return <DocumentTitle title="Test"><div>A Child</div></DocumentTitle>;
|
|
}
|
|
}
|