Skip to content
This repository has been archived by the owner on Sep 10, 2022. It is now read-only.

[Question] - what will happen to lifecycle()? #521

Closed
pr1ntr opened this issue Sep 19, 2017 · 9 comments
Closed

[Question] - what will happen to lifecycle()? #521

pr1ntr opened this issue Sep 19, 2017 · 9 comments

Comments

@pr1ntr
Copy link

pr1ntr commented Sep 19, 2017

I am not sure where to get the answer to this. I use lifecycle quite a bit and am wondering what to do when it is removed?

@istarkov
Copy link
Contributor

#510 (comment)

@j
Copy link

j commented Oct 5, 2017

@istarkov a link to a comment saying to search the forums? Can you please just write an issue about why it's being deprecated and answer the question that way? I search "lifecycle deprecate" and it's a pain to find.. I can't find what's going on?

@istarkov
Copy link
Contributor

istarkov commented Oct 5, 2017

Isn't it a pain for me write the same things? Do you think I remember the exact place, I also need to search so why me not you? ;-)

@j
Copy link

j commented Oct 5, 2017

@istarkov I'm still trying to search for it. Can't find anything. Nothing. Zilch. All I see are links to #510 which says to search for it and searching for it brings nothing. I mean, there'd be a lot less confusion with people if you actually answered or had the answer in a clear location and referred people to that. People are using your library and trusting in your library. Without a clear answer from the author himself, you lose that trust.

@j
Copy link

j commented Oct 5, 2017

Perhaps this is the answer. #280

@mcky
Copy link

mcky commented Oct 9, 2017

Hey @istarkov, I also had a look through the code and issues but couldn't find anything that really cleared up the depreciation reason. I'm happy to create a PR to the docs with it if you can point me in the right direction?

@timkindberg
Copy link
Contributor

It's discussed in various places:

The main reason for deprecation seems to be claims that:

  • It is a large source of bugs for the maintainer
  • It has a different api than the other HOCs. For example, how you have to access props via this.props rather than having them passed in as a function param.

I personally do not think it should be deprecated.

@mcky
Copy link

mcky commented Oct 10, 2017

Thanks, that makes a lot of sense, I think #500 and the usage of this was the missing piece in understanding

@machineghost
Copy link

machineghost commented Feb 5, 2018

One of the linked issues references https://github.com/deepsweet/hocs/tree/master/packages/with-lifecycle, which seems to answer all of the concerns about lifecycle here (it passes props in, doesn't reference a class instance, etc.). Instead of eliminating lifecycle completely why not just replace it with withLifecycle?

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

No branches or pull requests

6 participants