Hacker News new | past | comments | ask | show | jobs | submit login
React Gets First Class Support for Async/Await – Yay or Meh? (betterprogramming.pub)
12 points by anupamchugh on Oct 24, 2022 | hide | past | favorite | 1 comment



I’m probably being obtuse here but I don’t understand from the article why a client component could not be async.

If the use ‘hook’ can throw a promise (and by doing so defer future renders), why would the render pipeline not be able to distinguish between a ReactNode or Promise<ReactNode> and act accordingly?

With React.memo and the use hook it’s probably quite straightforward to create a HOC that does just that.

Furthermore, quite a few of my colleges are quite displeased about the `use` hook’s name, especially because of expected search issues due it being a very generic and common word.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: