realar-project / realar

5 kB Advanced state manager for React
MIT License
44 stars 0 forks source link

up: replace useMemo by useRef #95

Closed betula closed 3 years ago

betula commented 3 years ago

You may rely on useMemo as a performance optimization, not as a semantic guarantee. In the future, React may choose to “forget” some previously memoized values and recalculate them on next render, e.g. to free memory for offscreen components. Write your code so that it still works without useMemo — and then add it to optimize performance.

betula commented 3 years ago

Added to "the stream of conciseness 0.7+ roadmap"