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

Enable ESLint react/no-deprecated #24471

Merged
merged 2 commits into from
May 10, 2023
Merged

Conversation

nschonni
Copy link
Contributor

Opening as a draft to flag the current issues with https://legacy.reactjs.org/docs/react-component.html#unsafe_componentwillreceiveprops
These would be things needed to upgrade beyond React 16

@nschonni
Copy link
Contributor Author

@takayamaki maybe you have an idea of how these should be correctly updated to non-deprecated calls

@takayamaki
Copy link
Contributor

takayamaki commented Apr 16, 2023

In fact, I am not used to writing class-based components.
Life-cycle functions of class-based components are very complex and difficult.

Other hand, hooks components are modern and simple.
Also, hooks component can cover most of usecases.
An example of behavior that hooks components cannot perform is error boundary.

I seem better to rewrite these components with hooks.

@ClearlyClaire
Copy link
Contributor

afaik there are places where we do really rely on the old lifecycle methods and doing otherwise would require a very significant amount of work; that should only be a small portion of the code, though

@takayamaki
Copy link
Contributor

Yes, these deprecated life-cycle functions are just the tip of that iceberg.
We can improve everywhere.

@renchap renchap added javascript Pull requests that update Javascript code lint fix 💅 labels May 3, 2023
@nschonni nschonni mentioned this pull request May 8, 2023
@github-actions
Copy link
Contributor

github-actions bot commented May 9, 2023

This pull request has merge conflicts that must be resolved before it can be merged.

Ran `npx react-codemod rename-unsafe-lifecycles`
@github-actions
Copy link
Contributor

github-actions bot commented May 9, 2023

This pull request has resolved merge conflicts and is ready for review.

@nschonni nschonni marked this pull request as ready for review May 9, 2023 18:45
@nschonni
Copy link
Contributor Author

nschonni commented May 9, 2023

@renchap I ran the same autoconversion of the events from your React 18 PR

Copy link
Sponsor Member

@renchap renchap left a comment

Choose a reason for hiding this comment

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

Good with me 👍

@renchap renchap merged commit b878e3d into mastodon:main May 10, 2023
25 checks passed
@nschonni nschonni deleted the react-no-deprecated branch May 10, 2023 07:06
taichi221228 pushed a commit to taichi221228/mastodon that referenced this pull request May 16, 2023
skerit pushed a commit to 11ways/mastodon that referenced this pull request Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
javascript Pull requests that update Javascript code lint fix 💅
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants