Created
March 27, 2019 21:24
-
-
Save KendrickIW/4d242b8b15169da95bf510b0eaae2af2 to your computer and use it in GitHub Desktop.
Proposal for writing containers
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
import { connect } from 'react-redux' | |
// Dont import the component | |
const mapStateToProps = (state) => { | |
.... | |
} | |
const mapDispatchToProps = (dispatch) => { | |
.... | |
} | |
export default connect(mapStateToProps, mapDispatchToProps) |
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
import React, { Component } from 'react' | |
class FormUI extends Component { | |
.... | |
} | |
export default FormUI |
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
import FormUI from './FormUI' | |
import container from './container' | |
export default container(FormUI) // Combine component with container here |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment