Created
June 19, 2021 20:06
-
-
Save sabesansathananthan/6235bd8b3c1fcaf21a0b10e38e51bbf3 to your computer and use it in GitHub Desktop.
How React Components Are Reused
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
// React Redux's `connect` Function | |
const ConnectedComment = connect(commentSelector, commentActions)(CommentList); | |
// connect is a function, and its return value is another function. | |
const enhance = connect(commentListSelector, commentListActions); | |
// The return value is HOC, which will return components that have been connected to the Redux store | |
const ConnectedComment = enhance(CommentList); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment