Last active
September 19, 2020 07:48
-
-
Save vzaidman/aef029f9814b2983acdf58c31d8ad05b to your computer and use it in GitHub Desktop.
When App Re-renders, Main Also Re-renders.
This file contains 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 Main = ({userName}) => { | |
const content = heavyCalculation({userName}); | |
return ( | |
<div className="Main"> | |
{content} | |
</div> | |
); | |
} | |
export default function App({userName}) { | |
return ( | |
<div className="App"> | |
<Header /> | |
<Main userName={userName} /> | |
</div> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment