|
|
|
|
|
by flowerlad
1778 days ago
|
|
> you had to wrap your components into x number of HOCs to inject the props your component needed, risking props collision, making it really hard to debug... What kind of application are you developing? Do you have complex UI? Or just lots and lots of pages where you reuse components a lot? |
|
You end up with code like this at the bottom of your files
Although it's probably not that common anymore (as OC said, practices changed), it was a common pattern a few years ago.In the new project I started last week, I'm using only hooks/context and a few libraries like react-router (useHistory, useParams), react-query (useQuery, useMutation), react-hooks-form (useForm)… and it has been a breath of fresh air. react-query is definitely another "big shift", it completely changed the way I used to think about fetching data and centralize it. It's very good, I highly recommend to try it.