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

Remove componentWillReceiveProps usages in examples#1952

Closed
seadeep42 wants to merge 5 commits intofacebookarchive:masterfrom
seadeep42:fix/deprecated_react_lifecycle_methods
Closed

Remove componentWillReceiveProps usages in examples#1952
seadeep42 wants to merge 5 commits intofacebookarchive:masterfrom
seadeep42:fix/deprecated_react_lifecycle_methods

Conversation

@seadeep42
Copy link
Copy Markdown

Summary
Resolves 1940
Change usage of componentWillReceiveProps in Tex examples to componentDidUpdate

@claudiopro
Copy link
Copy Markdown
Contributor

Hi @Chaitanya-Deep, welcome to Draft.js and thanks for taking the time to look into this issue! This change looks good to me 👍🏼, sounds good to remove the sketchy setTimeouts also.

@claudiopro claudiopro self-assigned this Dec 11, 2018

componentWillReceiveProps(nextProps) {
if (nextProps.content !== this.props.content) {
componentDidUpdate(prevProps) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe worth calling out there's an unused prevState second argument here.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made the change but is that necessary?
The third snapshot argument is also unused.

And the docs for typical usage of componentDidUpdate don't include it either
https://reactjs.org/docs/react-component.html#componentdidupdate

Copy link
Copy Markdown

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@claudiopro is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Copy Markdown

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@niveditc has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Copy Markdown
Contributor

@niveditc niveditc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this! Requesting changes to split the gulp native update into a separate PR.

Copy link
Copy Markdown
Contributor

@niveditc niveditc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! :)

Copy link
Copy Markdown

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@niveditc has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

jdecked pushed a commit to twitter-forks/draft-js that referenced this pull request Oct 9, 2019
…1952)

Summary:
**Summary**
Resolves [1940](facebookarchive#1940)
Change usage of `componentWillReceiveProps` in Tex examples to `componentDidUpdate`
Pull Request resolved: facebookarchive#1952

Reviewed By: claudiopro

Differential Revision: D13417818

Pulled By: claudiopro

fbshipit-source-id: b13ff3140c3207cddaeb8d98c239f7dfd4b04a47
alicayan008 pushed a commit to alicayan008/draft-js that referenced this pull request Jul 4, 2023
Summary:
**Summary**
Resolves [1940](facebookarchive/draft-js#1940)
Change usage of `componentWillReceiveProps` in Tex examples to `componentDidUpdate`
Pull Request resolved: facebookarchive/draft-js#1952

Reviewed By: claudiopro

Differential Revision: D13417818

Pulled By: claudiopro

fbshipit-source-id: b13ff3140c3207cddaeb8d98c239f7dfd4b04a47
aforismesen added a commit to aforismesen/draft-js that referenced this pull request Jul 12, 2024
Summary:
**Summary**
Resolves [1940](facebookarchive/draft-js#1940)
Change usage of `componentWillReceiveProps` in Tex examples to `componentDidUpdate`
Pull Request resolved: facebookarchive/draft-js#1952

Reviewed By: claudiopro

Differential Revision: D13417818

Pulled By: claudiopro

fbshipit-source-id: b13ff3140c3207cddaeb8d98c239f7dfd4b04a47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants