-
-
Save hubgit/093834cba055a211a815165daecdd147 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
// child functions | |
export default ( | |
<Connect mapStateToProps={mapStateToProps} mapDispatchToProps={mapDispatchToProps}> | |
{props => ( | |
<WithRouter> | |
{router => ( | |
<Foo router={router} {...props}/> | |
)} | |
</WithRouter> | |
)} | |
</Connect> | |
) | |
// render functions | |
export default ( | |
<Connect mapStateToProps={mapStateToProps} mapDispatchToProps={mapDispatchToProps} render={props => ( | |
<WithRouter render={router => ( | |
<Foo router={router} {...props}/> | |
)}> | |
)}/> | |
) | |
// compose | |
export default compose( | |
connect(mapStateToProps, mapDispatchToProps), | |
withRouter | |
)(Foo) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment