Aljullu / react-lazy-load-image-component

React Component to lazy load images and components using a HOC to track window scroll position.
https://www.npmjs.com/package/react-lazy-load-image-component
MIT License
1.46k stars 110 forks source link

LazyLoadImage gives deprecation warnings on React 18 #131

Closed ryuuji3 closed 5 months ago

ryuuji3 commented 6 months ago

Bug description Rendering a <LazyLoadImage> component in React 18 gives a warning about deprecated findDOMNode usages

"dependencies": {
    "react": "^18.3.1",
    "react-dom": "^18.3.1",
    "react-lazy-load-image-component": "^1.6.0"
}

To Reproduce Paste the code that is producing the issue

import React from 'react';
import { LazyLoadImage } from 'react-lazy-load-image-component';

// Render a component using LazyLoadImage
function Component() {
   return <LazyLoadImage {/* props */} />
}

Link to a repo where this issue can be reproduced if available: https://github.com/ryuuji3/react-18-react-lazy-load-image-component-findDOMNode-deprecation

Expected behavior No warnings should be logged

Screenshots image

Technical details:

jotacodestudio commented 5 months ago

Hey @ryuuji3, thanks for notifying us of this! We just released version 1.6.1 which should remove this warning. Let us know if you have any problems with the update.

ryuuji3 commented 5 months ago

Thank you!