react-awesome-slider icon indicating copy to clipboard operation
react-awesome-slider copied to clipboard

UNSAFE_componentWillReceiveProps issue

Open smorfe opened this issue 6 years ago • 7 comments

index.js:1 Warning: Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. 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

Please update the following components: AwesomeSlider

smorfe avatar Apr 04 '20 04:04 smorfe

im also having this problem when using <img src='/path/to/source' />. However, I when I used <div data-src='/path/to/source' /> as recommended by the docs, it worked.

chalupagrande avatar Apr 20 '20 16:04 chalupagrande

This is also happening to me, even using div data-src='/path/to/source' />

tayan-serna avatar Aug 30 '20 18:08 tayan-serna

any updates ? bug is still there

enkhchuluun avatar Sep 21 '21 06:09 enkhchuluun

im having the same bug , any updates?

AmiryanZhora avatar Dec 14 '21 13:12 AmiryanZhora

I am also having the same bug. Hopefully this issue will be noticed.

rubenabruce avatar Jan 19 '22 14:01 rubenabruce

componentWillReceiveProps was renamed to componentDidUpdate. It is recommended to update this but seem that this package did not. One way around it is using the UNSAFE prefix as you have there but the error you getting is just telling you to be careful because that's not the way to resolve this issue. Updating this package is.

Tpleme avatar Jul 12 '22 09:07 Tpleme

Same issue here

      <AwesomeSlider key={`crs-container-${props.name}`} animation="cubeAnimation">
        {props.urls &&
          props.urls.map((url, idx) => {
            return (
              <div
                data-src={url}
                key={`crs-img-${props.name}-${idx}`}
                style={{ maxWidth: '100%', maxHeight: '100%' }}
              />
            );
          })}
      </AwesomeSlider>

The error:

react-dom.development.js:86 Warning: Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/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://reactjs.org/link/derived-state

Please update the following components: AwesomeSlider

image

greenpau avatar Jul 17 '23 13:07 greenpau