Skip to content

Instantly share code, notes, and snippets.

@jamilalisgandarov
Created October 8, 2020 13:44
Show Gist options
  • Save jamilalisgandarov/826f7e594841d53bb915e4890d78041d to your computer and use it in GitHub Desktop.
Save jamilalisgandarov/826f7e594841d53bb915e4890d78041d to your computer and use it in GitHub Desktop.
const Component: React.FC = ({ listOfItems,first,second }) => {
const list = useMemo(
() => listOfItems.map(item => ({
...item,
itemProp1: expensiveFunction(first),
itemProp2: anotherPriceyFunction(second)
})),
[listOfItems]
)
return // render list as you wish
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment