@react.dev in the old docs for useMemo (legacy.reactjs.org/docs/hooks-r...), you could read: > In the future, React may choose to “forget” some previously memoized values and recalculate them on next render But I can’t find any similar mentions of this in the new ones in react.dev/reference/re...
Post
legacy.reactjs.orgHooks API Reference – ReactA JavaScript library for building user interfaces
@tkdodo.eu, do you know if React changed how it was handling `useMemo()` under the hood? (as you talked about it a few years ago in tkdodo.eu/blog/use-sta...)
tkdodo.euuseState for one-time initializationsWhy you shouldn't rely on useMemo for guaranteed referential stability but prefer useState instead
It’s still the same: no semantic guarantee, only a performance improvement, your code should work exactly the same when useMemo is removed. If anything, offscreen rendering (<Activity>) will lead to more memos being thrown away.
1 repost1 like