react-no-ssr typings (#27738)

* react-no-ssr typings

* fix tests
This commit is contained in:
Rafał Filipek
2018-08-01 00:45:03 +02:00
committed by Sheetal Nandi
parent e425a450ce
commit b6f7118f87
4 changed files with 47 additions and 0 deletions

11
types/react-no-ssr/index.d.ts vendored Normal file
View File

@@ -0,0 +1,11 @@
// Type definitions for react-no-ssr 1.1
// Project: https://github.com/kadirahq/react-no-ssr
// Definitions by: Rafał Filipek <https://github.com/rafalfilipek>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.6
import * as React from 'react';
export default class NoSSR extends React.Component<{
onSSR?: React.ReactChild;
}> {}

View File

@@ -0,0 +1,17 @@
import * as React from 'react';
import NoSSR from 'react-no-ssr';
export class NoSSRTest extends React.Component {
render() {
return (
<div>
<NoSSR>
<div />
</NoSSR>
<NoSSR onSSR={<span />}>
<div />
</NoSSR>
</div>
);
}
}

View File

@@ -0,0 +1,18 @@
{
"files": ["index.d.ts", "react-no-ssr-tests.tsx"],
"compilerOptions": {
"module": "commonjs",
"lib": ["es6", "dom"],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"jsx": "react",
"experimentalDecorators": true,
"typeRoots": ["../"],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
}
}

View File

@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }