Memoization is a React caching function that caches a computed value.
It
React memo is the equivalent of shouldComponentUpdate for a class component.
It will:
It's a higher-order component React.memo(), meaning it wraps a component
export default React.memo(function myFunctionComponent(props: any): any {
// big computation
return ();
});
const sameReference = useMemo(()=>["element1","element2"], [])
If the function does not have any dependencies
const [helloWorld] = useState(() => return "Hello World")