It clicked with me when I researched the internals of the new fiber architecture, which is basically tree-walking over fiber nodes, which can be elements or hooks.
The whole architecture is based on memoization (call caching) and tree-walking during different cycles (mount, render, layout, unmount).
useRef(value) is basically useState(value)[0]. useCallback(fn, deps) is a shorthand for useMemo(() => fn, deps).
So you're left with useState, useMemo, useEffect and useLayoutEffect, the latter just being evaluated during different cycles.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
It clicked with me when I researched the internals of the new fiber architecture, which is basically tree-walking over fiber nodes, which can be elements or hooks.
The whole architecture is based on memoization (call caching) and tree-walking during different cycles (mount, render, layout, unmount).
useRef(value)
is basicallyuseState(value)[0]
.useCallback(fn, deps)
is a shorthand foruseMemo(() => fn, deps)
.So you're left with
useState
,useMemo
,useEffect
anduseLayoutEffect
, the latter just being evaluated during different cycles.