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

Warning: componentWillReceiveProps has been renamed, and is not recommended for use. #83

Closed
BrianMitchL opened this issue Sep 3, 2019 · 9 comments

Comments

@BrianMitchL
Copy link
Contributor

With react 16.9+, componentWillReceiveProps has been deprecated. Due to the large range of supported react versions with react-placeholder, a fix for this will require a major version change. The current uses could be moved to UNSAFE_componentWillReceiveProps, but I'm not sure if that is available as far back as react 0.14. Is it time for a version that requires react 16.8+ and is built with hooks? 😄

@orangecoding
Copy link

Any eta when we can expect a new release with the changes?

@gromchen
Copy link

gromchen commented Oct 3, 2019

It would be nice to have it soon.

@remijean
Copy link

Soon a new version?

@BrianMitchL
Copy link
Contributor Author

This issue has been pretty quiet, so I'd be happy to take it on! A couple of things come across my mind first:

  1. I would like to propose dropping support for react <16.8.0 so it can be built using hooks.
  2. With the high usage of TypeScript in recent years, and added complexity with mixing prop-types and Typescript, I think that prop-types could be removed.
  3. I think the build tooling could switch to rollup, even using something like tsdx would make this really easy.

To do this upgrade, I would first enhance the test suite for the current version. Then migrate to hooks and function components, and ensure that the tests still pass, or do with minimal changes.

Any thoughts?

@giogonzo
Copy link
Member

@BrianMitchL sounds like a great plan to me!

I completely agree on 1 and 2 (and maybe adding some more tests as a prerequisite)

Not 100% about 3. It doesn't look strictly necessary as of now and/or could be split into a separate effort

@BrianMitchL
Copy link
Contributor Author

Good point, number 3 isn't really related, I'll skip that for this effort 🙂 Thanks for the feedback!

@BrianMitchL
Copy link
Contributor Author

I got a really good start on this, but got busy with the holidays, and soon some other obligations. I plan to get back into working on this in another few weeks!

@BrianMitchL
Copy link
Contributor Author

I pushed my work up to https://github.com/BrianMitchL/react-placeholder/tree/hooks if anyone wants to take a look. I tried to make the props stricter and more polymorphic, currently having a few issues with that. The example page seems to work the same when ignoring types. I need to fix that type issue, and would like to write a few more unit tests as well.

@BrianMitchL BrianMitchL mentioned this issue Feb 16, 2020
@giogonzo
Copy link
Member

closed by #85

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

No branches or pull requests

5 participants