joshwnj / react-visibility-sensor

Sensor component for React that notifies you when it goes in or out of the window viewport.
MIT License
2.32k stars 195 forks source link

TS2694: Namespace 'React' has no exported member 'StatelessComponent' #196

Open OmKessarwani opened 9 months ago

OmKessarwani commented 9 months ago

Issue: `node_modules/react-visibility-sensor/index.d.ts:34:38 - error TS2694: Namespace 'React' has no exported member 'StatelessComponent'.

34 const ReactVisibilitySensor: React.StatelessComponent;



Found 1 error in node_modules/react-visibility-sensor/index.d.ts:34`

**React: 18.2.0**

Probable Solution: In index.d.ts at line 34. replace 
`const ReactVisibilitySensor: React.StatelessComponent<Props>;`

with 

`const ReactVisibilitySensor: React.FC<Props>;`