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

fix(TransitionablePortal): fixed deprecated lifecycle method #2732 #3922

Conversation

shachar731945
Copy link

  • removed deprecated componentWillReceiveProps lifecycle

  • changed it to componentDidUpdate

  • changed test description to componentDidUpdate

it is worth mentioning that it is not advised to use getDerivedStateFromProps in this case due to the different time this hook is getting called in contrast to componentDidUpdate which also does not require change from any of the test

* removed deprecated componentWillReceiveProps lifecycle hook

* changed it to componentDidUpdate

* changed test description to componentDidUpdate
@welcome
Copy link

welcome bot commented Mar 29, 2020

💖 Thanks for opening this pull request! 💖

Here is a list of things that will help get it across the finish line:

  • Run yarn lint locally to catch formatting errors. This will fix some errors automatically, commit and push any changes.
  • Run yarn test locally to catch errors. This ensures all components still behave as they should.
  • Run yarn start to run the doc site locally and try a few pages, ensuring everything is in good working order.
  • Include tests when adding/changing behavior.

We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.

@shachar731945
Copy link
Author

my circle ci checks are not working because i have setState in componentDidUpdate. I would like to know if this check is missused in the circleci checks or is there an actual reason for it. thanks from ahead.

@NicholasG04
Copy link

@layershifter
Copy link
Member

Oops, folks 😿 I missed that this PR exists...

I did an update in #3966 and you can check it if you're interested. In general when there is UNSAFE_componentWillReceiveProps that performs setState() it should be replaced with getDerivedStateFromProps() as otherwise componentDidUpdate() will cause double render.

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 this pull request may close these issues.

None yet

3 participants