Skip to content

Remove componentWillReceiveProps warning.#651

Open
arturcarvalho wants to merge 2 commits intonamespace-ee:mainfrom
arturcarvalho:642
Open

Remove componentWillReceiveProps warning.#651
arturcarvalho wants to merge 2 commits intonamespace-ee:mainfrom
arturcarvalho:642

Conversation

@arturcarvalho
Copy link
Contributor

Fix for #642.

I've ran the npx react-codemod react-to-react-dom <path> to fix the CustomHeader. This is sort of a quick fix, maybe later I can look at the code and try to change it to a proper fix.

I've npm linked and tested it in a project and it looks good, no errors.
The tests pass, but the npm run lint showed a lot of errors. Not sure if this is normal.

I may have some time available during the weekend, so if there's any changes to be done on the branch just let me know.

Hope this helps!

@Ilaiwi
Copy link
Collaborator

Ilaiwi commented Sep 12, 2019

@arturcarvalho thank you for this PR. Maybe we can change this to use componentDidUpdate instead? I mean if we are removing it eventually why not do it now.
for eslint. yes we don't follow these rules. I might just remove them in the near future.

@arturcarvalho
Copy link
Contributor Author

I'm not sure what you mean about componentDidUpdate, because that should be after the render, and componentWillReceiveProps is before. I've changed it to use getDerivedStateFromProps, it seems to be the closest to it.

Running the project and going through the examples looks good.

I get the "Maximum call stack size exceeded", although I got it also before.

@gvdlangenberg
Copy link

Any update on this?

@owen-stellar
Copy link

Can we get this PR merged please?

@rhuanbarreto
Copy link

It's been almost a year. Maybe a fork is a good solution.

@bflamand
Copy link

What is status on this issue ? Failing to update that could potentially break support for the new React 18.
Has someone started a better supported fork somewhere?

@lnagel lnagel added the outdated label Feb 5, 2026
@lnagel
Copy link
Member

lnagel commented Feb 5, 2026

This PR has been marked as outdated. Here's why:

The issue this PR fixed — replacing the deprecated componentWillReceiveProps lifecycle method in CustomHeader.js — has been fully resolved by the codebase rewrite for v0.30.0-beta.5:

  • src/lib/headers/CustomHeader.js has been rewritten as src/lib/headers/CustomHeader.tsx in TypeScript
  • The new CustomHeader.tsx no longer uses componentWillReceiveProps or getDerivedStateFromProps (the approach this PR took). There are zero occurrences of componentWillReceiveProps anywhere in the current source
  • The entire codebase has been migrated from JavaScript to TypeScript, from moment.js to dayjs, and from Enzyme to @testing-library/react
  • This PR only touched a single file (src/lib/headers/CustomHeader.js) which no longer exists

The deprecation warning is no longer an issue since the component has been completely rewritten.

Thank you for the contribution! The idea/fix was appreciated even if the codebase has moved on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants