Skip to content

Commit 277b38f

Browse files
committed
Update types in index.d.ts
React.StatelessComponent has been removed from the react types (see https://stackoverflow.com/questions/44375759/how-should-i-declare-a-stateless-functional-component-with-typescript-in-react) The current types trigger an error: ``` node_modules/react-visibility-sensor/index.d.ts:34:38 - error TS2694: Namespace 'React' has no exported member 'StatelessComponent'. 34 const ReactVisibilitySensor: React.StatelessComponent<Props>; ~~~~~~~~~~~~~~~~~~ ```
1 parent b32ab63 commit 277b38f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: index.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ declare module "react-visibility-sensor" {
3131
) => React.ReactNode);
3232
}
3333

34-
const ReactVisibilitySensor: React.StatelessComponent<Props>;
34+
const ReactVisibilitySensor: React.ComponentType<Props>;
3535

3636
export default ReactVisibilitySensor;
3737
}

0 commit comments

Comments
 (0)