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

Remove componentWillReceiveProps usages in examples #1952

Closed
wants to merge 5 commits into from
Closed

Remove componentWillReceiveProps usages in examples #1952

wants to merge 5 commits into from

Conversation

seadeep42
Copy link

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

@claudiopro
Copy link
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
}

componentDidMount() {
this._update();
}

componentWillReceiveProps(nextProps) {
if (nextProps.content !== this.props.content) {
componentDidUpdate(prevProps) {
Copy link
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
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

@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

@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.

package.json Outdated Show resolved Hide resolved
Copy link
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
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

@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