Skip to content
This repository has been archived by the owner on Mar 30, 2023. It is now read-only.

Rename unsafe lifecycles #22

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

Sabir001
Copy link

componentWillMount and componentWillReceiveProps are not recommended to use. From React 17.x, only the UNSAFE_ name will work. UNSAFE alias was introduced in React version 16.3.

Had to also disable eslint for camelcase rule.

In the future, we can use componentDidMount instead of componentWillMount and componentDidUpdate instead of componentWillReceiveProps.

@ljmerza
Copy link

ljmerza commented Oct 17, 2019

I think we should fix the underlying problem considering how little amplitude communicates.

@Sabir001
Copy link
Author

Sabir001 commented Oct 20, 2019

I think we should fix the underlying problem considering how little amplitude communicates.
Related to unsafe lifecycles?

I think we should replace these lifecycle methods. We should use componentDidMount instead of componentWillMount and componentDidUpdate instead of componentWillReceiveProps.

But, that should be properly tested. So, before making that change I think we should just use the UNSAFE prefix first so that anyone can jump to 17.x when it arrives.

@Jdban
Copy link

Jdban commented Sep 10, 2020

Can this be merged soon so I stop seeing warnings? :)

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

Successfully merging this pull request may close these issues.

None yet

4 participants