Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code #659

Open
AshrinJose opened this issue Jan 13, 2022 · 9 comments

Comments

@AshrinJose
Copy link

  • [X ] I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

React warning for UNSAFE_componentWillReceiveProps should be gone.

Current Behavior

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: AutoPlay, ReactSwipableView

Steps to Reproduce (for bugs)

  1. update react version to latest code
  2. download the latest react-swipeable-views and react-swipeable-views-utils
  3. write code to show a swipeable images/...
  4. check the development console

Context

Got React Error in development console about breaking code

Your Environment

| react-swipeable-views | ^0.14.0 |
| React | ^17.0.2 |

@korbav
Copy link

korbav commented Jan 13, 2022

Hi @AshrinJose , I filed a PR targeting this precise issue, but unfortunately the repo hasn't been active for the last few months.

#654

@oliviertassinari
Copy link
Owner

Correct, it don't have time to allocate to this repo. It had served this purpose for me in the past, I haven't really spent time on it since the incorporation on MUI Inc. I assume there are better solutions in the React community for solving this problem now, no?

@korbav
Copy link

korbav commented Jan 14, 2022

Hi @oliviertassinari, I imagine you must be quite busy with the awesome MUI library!
Concerning this repo, I guess that, according to the 240K downloads a week, it's still being widely used by the community.
When you say better solutions to solve this problem, do you mean similar components ? if so, then it might be judicious to tag the repo as deprecated or at least no longer maintained.

@danielo515
Copy link

Correct, it don't have time to allocate to this repo. It had served this purpose for me in the past, I haven't really spent time on it since the incorporation on MUI Inc. I assume there are better solutions in the React community for solving this problem now, no?

According to their docs, MUI is using this library for their swipe able views, am I right? If so, they may want to allocate some resources to this library or even include it as part of mui/lab

@SebHex
Copy link

SebHex commented Feb 6, 2022

@oliviertassinari, we would love a merge on the pull request to resolve this issue

This repo is a great addition to MUI and is used by many

npm downloads

@millermeares
Copy link

Commenting to emphasize this - some projects have this project as a dependency and now have this error too.

@alecsandru66
Copy link

It's frustrating that mui uses this library and we all still have this issue. Kindly asking for a fix.

@markedwards
Copy link

Please either fix this or inform the MUI project that this will not be fixed so that project can take appropriate action.

@tdrdimov-dvlpr
Copy link

Just commenting here for others, found from the comment above that shares a PR with the fix that haven't been merged yet but this fixed it for me: #654 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants