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

Rename unsafe lifecycles#22

Open
Sabir001 wants to merge 4 commits intoamplitude:masterfrom
Sabir001:master
Open

Rename unsafe lifecycles#22
Sabir001 wants to merge 4 commits intoamplitude:masterfrom
Sabir001:master

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.

4 participants