You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 10, 2022. It is now read-only.
Not sure if this is a dumb question -- apologies in advance if so. It's a beginner question, but unrelated to #264.
Say I want to add an ajax call to my widget's componentWillMount. If this use case + a propTypes declaration is all I need, why not implement with only recompose functions and a stateless component? What's the idiomatic way to write a component with only these two requirements (propTypes, componentWillMount)?
See title: why is use of lifecyclean escape hatch? Should I default to using a class here? Source is the docs, and remembering part of @acdlite 's ReactEurope talk (timestamped) where how he observed "excessive" overuse of HoCs. More generally, what are things I should always do in classes? What is the set of things I can do in HoCs, and how can I learn more about the subset of cases where I can do something with a HoC but should use a class instead?
My team is new to recompose, uses classes for almost everything, and is very open to new ideas. We're starting a new, fairly large project. I'd be extremely appreciative of some context to help inform our standards/conventions. Genuinely interested and hoping to learn more about how to use this library. Happy to summarize add a PR to the docs if this discussion merits it.
Thanks!
The text was updated successfully, but these errors were encountered:
componentWillMount is not a good place for ajax calls, and I'm talking not even about server rendering, but here is a good discussion about.
IMO No idiomatic way how you will write your components, it depends on your code style, on component requirements, usage etc.
lifecycle please read IMO this enhancer not needed at all.
what are things I should always do in classes IMO every time you need refs, window like event processing ('resize' etc), or aggressive code optimizations you should use classes. For some controls you can publish it's not bad to avoid external dependencies.
Just be easy, think less about idiomatic ways and other things, try different solutions, there is no need to be on edge case and use only functional components and recompose.
My team use recompose because it makes code linear and more readable, it took some time before every team member started to love this library ;-)
Not sure if this is a dumb question -- apologies in advance if so. It's a beginner question, but unrelated to #264.
Say I want to add an ajax call to my widget's
componentWillMount
. If this use case + a propTypes declaration is all I need, why not implement with onlyrecompose
functions and a stateless component? What's the idiomatic way to write a component with only these two requirements (propTypes, componentWillMount)?See title: why is use of
lifecycle
an escape hatch? Should I default to using a class here? Source is the docs, and remembering part of @acdlite 's ReactEurope talk (timestamped) where how he observed "excessive" overuse of HoCs. More generally, what are things I should always do in classes? What is the set of things I can do in HoCs, and how can I learn more about the subset of cases where I can do something with a HoC but should use a class instead?My team is new to
recompose
, uses classes for almost everything, and is very open to new ideas. We're starting a new, fairly large project. I'd be extremely appreciative of some context to help inform our standards/conventions. Genuinely interested and hoping to learn more about how to use this library. Happy to summarize add a PR to the docs if this discussion merits it.Thanks!
The text was updated successfully, but these errors were encountered: