From 277b38f6fbca45c85cc459e1cfb517bdc56d80db Mon Sep 17 00:00:00 2001 From: Hippolyte Pello Date: Wed, 15 Feb 2023 17:46:41 +0100 Subject: [PATCH] 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; ~~~~~~~~~~~~~~~~~~ ``` --- index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.d.ts b/index.d.ts index dacbea3..3e92f5e 100644 --- a/index.d.ts +++ b/index.d.ts @@ -31,7 +31,7 @@ declare module "react-visibility-sensor" { ) => React.ReactNode); } - const ReactVisibilitySensor: React.StatelessComponent; + const ReactVisibilitySensor: React.ComponentType; export default ReactVisibilitySensor; }