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

componentWillMount is deprecated from RN .60 #85

Open
dbarner1 opened this issue Jul 11, 2019 · 6 comments · May be fixed by #126
Open

componentWillMount is deprecated from RN .60 #85

dbarner1 opened this issue Jul 11, 2019 · 6 comments · May be fixed by #126

Comments

@dbarner1
Copy link

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

@gharsallahmoez
Copy link

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.

@ghasemikasra39
Copy link

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.

@ighosh07
Copy link

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

@ghost
Copy link

ghost commented Jul 19, 2021

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

@vliegelientje
Copy link

vliegelientje commented Feb 4, 2022

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?

@Nilmanduil Nilmanduil linked a pull request Aug 3, 2022 that will close this issue
@Nilmanduil
Copy link

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

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

Successfully merging a pull request may close this issue.

6 participants