Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

React.memo example:

export function MyReactComponent({ myNumber }) {
  return <p>{myNumber * 5}</p>
}

export default React.memo(MyReactComponent, function areEqual(
  prevProps,
  nextProps
) {
  if (prevProps.myNumber !== nextProps.myNumber) {
    return false
  }
  return true
})
Source by atomizedobjects.com #
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
4+9 =