Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

usememo

//when just a or b dependency change memoizedValie is work
// we are doing for when your component rendering but this memorizedValue to complexity have
// and you just want to render this complexity codes when a or b changes

const memoizedValue = useMemo(() => {
return computeExpensiveValue(a, b)

}, [a, b]);



Source by reactjs.org #
 
PREVIOUS NEXT
Tagged: #usememo
ADD COMMENT
Topic
Name
2+2 =