diff --git a/types/react-infinite-scroll-component/index.d.ts b/types/react-infinite-scroll-component/index.d.ts
index e5166be3c6..4e2ba078f5 100644
--- a/types/react-infinite-scroll-component/index.d.ts
+++ b/types/react-infinite-scroll-component/index.d.ts
@@ -4,9 +4,9 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.6
-///
+import * as React from 'react';
-declare module InfiniteScroll {
+declare namespace InfiniteScroll {
interface InfiniteScrollProps {
/**
* Set the length of the data.This will unlock the subsequent calls to next.
@@ -28,7 +28,7 @@ declare module InfiniteScroll {
/**
* This message is shown to the user when he has seen all the records which means he's at the bottom and hasMore is false
*/
- endMessage: React.ReactNode
+ endMessage: React.ReactNode;
/**
* You can send a loader component to show while the component waits for the next load of data. e.g.
Loading...
or any fancy loader element
@@ -99,9 +99,5 @@ declare module InfiniteScroll {
}
}
-declare class InfiniteScroll extends React.Component {}
-
-declare module 'react-infinite-scroll-component' {
- export = InfiniteScroll;
- export as namespace InfiniteScroll;
-}
+declare class InfiniteScroll extends React.Component {}
+export = InfiniteScroll;
diff --git a/types/react-infinite-scroll-component/react-infinite-scroll-component-tests.tsx b/types/react-infinite-scroll-component/react-infinite-scroll-component-tests.tsx
index ad515bb7bd..2b5a01d4cc 100644
--- a/types/react-infinite-scroll-component/react-infinite-scroll-component-tests.tsx
+++ b/types/react-infinite-scroll-component/react-infinite-scroll-component-tests.tsx
@@ -1,3 +1,4 @@
+import * as React from 'react';
import * as InfiniteScroll from 'react-infinite-scroll-component';
const options: JSX.Element[] = [
@@ -8,7 +9,8 @@ const options: JSX.Element[] = [
const props: InfiniteScroll.InfiniteScrollProps = {
dataLength: 4,
hasMore: true,
- endMessage: 'The end.'
+ endMessage: 'The end.',
+ next: () => null,
};
-{options}
\ No newline at end of file
+{options};
diff --git a/types/react-infinite-scroll-component/tsconfig.json b/types/react-infinite-scroll-component/tsconfig.json
index f2d3d0d9bb..b1a54cd2ea 100644
--- a/types/react-infinite-scroll-component/tsconfig.json
+++ b/types/react-infinite-scroll-component/tsconfig.json
@@ -7,6 +7,8 @@
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
+ "strictFunctionTypes": true,
+ "jsx": "react",
"baseUrl": "../",
"typeRoots": [
"../"
diff --git a/types/react-infinite-scroller/index.d.ts b/types/react-infinite-scroller/index.d.ts
index 066714344c..d0c3141f17 100644
--- a/types/react-infinite-scroller/index.d.ts
+++ b/types/react-infinite-scroller/index.d.ts
@@ -66,4 +66,4 @@ declare namespace InfiniteScroll {
namespace InfiniteScroll {}
}
-export = InfiniteScroll.InfiniteScroll;
+export = InfiniteScroll;