Last active
December 28, 2021 19:44
-
-
Save onosendi/5b6a8218898aa6d0e881737352c483b3 to your computer and use it in GitHub Desktop.
React named function declarations
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 ForwardRef = React.forwardRef(({}, ref) => { | |
return <div ref={ref}>Foo</div>; | |
}); | |
export default ForwardRef; |
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
export default function FunctionalComponent() { | |
return null; | |
} |
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
function Memo() { | |
return null; | |
} | |
export default React.memo(Memo); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment