I was trying to find a concise answer to this on the web without luck.
Is the following correct regarding the differences between useEffect, useMemo and useState?
- Both
useStateanduseMemowill remember a value across renders. The difference is that:useMemodoes not cause a re-render, whileuseStatedoesuseMemoonly runs when its dependencies (if any) have changed, whilesetSomeState(second array item returned byuseState) does not have such a dependency array
- Both
useMemoanduseEffectonly runs when their dependencies change (if any). The difference is that:useEffectruns after a render happens, whileuseMemoruns before
Any other key differences I have missed?