react-swipeable-views
react-swipeable-views copied to clipboard
Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code
- [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)
- update react version to latest code
- download the latest react-swipeable-views and react-swipeable-views-utils
- write code to show a swipeable images/...
- 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 |
Hi @AshrinJose , I filed a PR targeting this precise issue, but unfortunately the repo hasn't been active for the last few months.
https://github.com/oliviertassinari/react-swipeable-views/pull/654
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?
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.
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
@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
Commenting to emphasize this - some projects have this project as a dependency and now have this error too.
It's frustrating that mui uses this library and we all still have this issue. Kindly asking for a fix.
Please either fix this or inform the MUI project that this will not be fixed so that project can take appropriate action.
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: https://github.com/oliviertassinari/react-swipeable-views/pull/654#issuecomment-985789605