react-native-swipeable icon indicating copy to clipboard operation
react-native-swipeable copied to clipboard

componentWillMount is deprecated from RN .60

Open dbarner1 opened this issue 6 years ago • 6 comments

May simply work to replace with ComponentDidMount. Not sure the impact.

dbarner1 avatar Jul 11 '19 20:07 dbarner1

simply create a file in your project called Swipeable.js contain this code and import it : https://github.com/jshanson7/react-native-swipeable/blob/master/src/index.js

change componentWillMount function to ComponentDidMount

work perfect for me.

gharsallahmoez avatar Nov 07 '19 07:11 gharsallahmoez

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

* Move code with side effects to componentDidMount, and set initial state in the constructor.
* Rename componentWillMount to UNSAFE_componentWillMount 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: Swipeable

I am getting the same issue. The contributors need to fix this.

ghasemikasra39 avatar Nov 10 '20 21:11 ghasemikasra39

1.Go to your node modules and navigate to 'react-native-swipeable' folder. 2. open index.js 3. go to line number 297 4. update componentWillMount to UNSAFE_componentWillMount 5. do the same for 298 6. save 7. do npm cache clean --force 8. npm install

Worked for me.Not getting the warning. image

ighosh07 avatar Jan 27 '21 13:01 ighosh07

I see if fixed on master. Could you create a new tag? :)

ghost avatar Jul 19 '21 15:07 ghost

Still the same problem here. Looks like this project isn't maintained anymore. I get tons of deprecation warnings like this. Don't feel like hacking around in the node modules. Does anybody know an alternative?

vliegelientje avatar Feb 04 '22 13:02 vliegelientje

Fixed in the fork I published : https://www.npmjs.com/package/react-native-swipeable-reborn

Nilmanduil avatar Aug 04 '22 08:08 Nilmanduil