saigon-oss / react-photoswipe-2

PhotoSwipe, PhotoSwipeGallery component for ReactJS base on PhotoSwipe.
6 stars 2 forks source link

Deprecated life cycle usage, `componentWillReceiveProps` #4

Open imekachi opened 4 years ago

imekachi commented 4 years ago

There is a warning in console.

Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-unsafe-component-lifecycles for details.

  • Move data fetching code or side effects to componentDidUpdate.
  • If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state
  • Rename componentWillReceiveProps to UNSAFEcomponentWillReceiveProps to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE name will work. To rename all deprecated lifecycles to their new names, you can run npx react-codemod rename-unsafe-lifecycles in your project source folder.

Please update the following components: t

This library will break when using with react@17 please update the life cycle usage.

Kapaak commented 3 years ago

Its unfortunate that this has gotten no response. Will migrate to https://peterpalau.github.io/react-bnb-gallery/#/getting-started .