Created
October 26, 2018 13:17
-
-
Save tommmyy/54e2062db9060cddc6ab82c5309e3569 to your computer and use it in GitHub Desktop.
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
import React, { useMemo } from 'react'; | |
const Section = ({ heading, children }) => { | |
const headingChild = useMemo(() => <h1>{heading}</h1>, [heading]); | |
return ( | |
<section> | |
{headingChild} | |
{children} | |
</section> | |
); | |
}; | |
const PatternMemoChildren = () => <Section heading="Heading">Content.</Section>; | |
export default PatternMemoChildren; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment