Zhenghao He

zhenghao.io · Personal blog · on HN since 2022

Zhenghao He is a front-end engineer who writes about React, JavaScript and TypeScript, plus system design interviews.

What HN saysHN commenters point to his posts on React memoization and system design interviews, and recommend the site to people interested in JavaScript, TypeScript and web development.
15HN people shared it
5linked it in comments
18stories submitted
381story points
4 years agolast shared
2022people per year2026

Most-shared posts

  1. 1
  2. 2
    When You Should Prefer Map over Object in JavaScript
    3 people · 6 points · first shared 2022 · discussion on HN
  3. 3
    Front End vs. Back End System Design Interviews
    3 people · 1 points · first shared 2022 · 1 comments on HN
  4. 4
    When Does React Render Your Component?
    2 people · 4 points · first shared 2022 · discussion on HN
  5. 5
    The Double-Assignment Pattern in jQuery's Source Code
    2 people · 4 points · first shared 2022 · discussion on HN
  6. 6
    Front End vs. Back End System Design Interviews
    2 people · 2 points · first shared 2022 · discussion on HN
  7. 7
    An introduction to type programming in TypeScript
    1 people · 148 points · first shared 2022 · 65 comments on HN
  8. 8
    A complete guide to TypeScript’s 'never' type
    1 people · 95 points · first shared 2022 · 63 comments on HN
  9. 9
    Include debugging in the interview process
    1 people · 67 points · first shared 2022 · 16 comments on HN
  10. 10
    Type Polymorphic Functions in TypeScript
    1 people · 37 points · first shared 2022 · 14 comments on HN
  11. 11
    JSON and the Stringification Oddities in JavaScript
    1 people · 4 points · first shared 2022 · discussion on HN
  12. 12
    The type hierarchy tree in TypeScript
    1 people · 2 points · first shared 2022 · discussion on HN
  13. 13
    Detect JavaScript Memory Leaks with QueryObjects
    1 people · 2 points · first shared 2022 · discussion on HN

What HN people wrote when they linked it

acemarke · 2022-07-05
I would strongly suggest reading through my extensive post "A (Mostly) Complete Guide to React Rendering Behavior" [0], which walks through what "rendering" actually is, what triggers it, React's default behavior, and ways to optimize the behavior by skipping renders for certain components. The post "When Does React Render Your Component?" [1] is also excellent. The short summary is that React queues a render when you call some form of `setState()`, renders this component, and by default recursively renders all children inside this component too. Everything else is variations on that idea. [0] https://blog.isquaredsoftware.com/2020/05/blogged-answers-a-mostly-com… [1] https://www.zhenghao.io/posts/react-rerender
Pr0ject217 · 2022-02-07
EDIT: Paste this hacky snippet into your browser's console to save all of the links into your clipboard: (() => { let result = [...document.querySelectorAll('td a')] .map((link) => link && !link.href.includes('ycombinator') && !link.href.includes('javascript:void') ? link.href : '' ) .filter(Boolean); result = [...new Set(result)]; result.sort(); copy(result.join('\n\n')); })(); Just to help, here's a compiled-list of all of the links shared here so…
gururu · 2022-02-07
Me, myself: https://www.zhenghao.io/ Check it out if you are interested in JavaScript, TypeScript, or web development in general
Etheryte · 2022-01-17
It looks like you submitted the wrong link judging by the title, did you mean https://www.zhenghao.io/posts/system-design-interviews instead ?
andrewingram · 2022-03-21
That's why a number of people (myself included) advocate for overzealous/defensive use of useMemo/useCallback as a means of ensuring that a prop changing is always meaningful. The rationale is summarised here: https://www.zhenghao.io/posts/memo-or-not There are good reasons for _not_ doing this, since using these hooks isn't free; and technically speaking useMemo isn't an identity guarantee (though it currently behaves as one), but I haven't experienced any of the common useEffect pitfalls since adopting this methodology a couple of years ago. But as my sibling comment points out, a lot of the need for this defensive coding would go away if there were more ways of defining equivalence. I hope that one day the record and tuple proposals land, which should help a bit. But i'd also like to see something like Python's __eq__ and __hash__ in JavaScript too - perhaps done in a similar way to [Symbol.iterator].

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close