Recompose: [Question] - what will happen to lifecycle()?

Created on 19 Sep 2017  路  9Comments  路  Source: acdlite/recompose

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?

Most helpful comment

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?

All 9 comments

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

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? ;-)

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

Perhaps this is the answer. #280

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?

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.

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

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?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Secretmapper picture Secretmapper  路  3Comments

istarkov picture istarkov  路  3Comments

rndmerle picture rndmerle  路  3Comments

isubasti picture isubasti  路  3Comments

nemocurcic picture nemocurcic  路  3Comments