Created
October 8, 2020 13:44
-
-
Save jamilalisgandarov/826f7e594841d53bb915e4890d78041d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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