Created
October 8, 2020 13:44
-
-
Save jamilalisgandarov/826f7e594841d53bb915e4890d78041d to your computer and use it in GitHub Desktop.
Revisions
-
Jamil Alisgandarov created this gist
Oct 8, 2020 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ 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 }