Created
September 29, 2015 13:43
-
-
Save jackcallister/49cec90e20d51ff6b109 to your computer and use it in GitHub Desktop.
Smart Dumb Pattern
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, { PropTypes } from 'react' | |
export default class Dumb { | |
static propTypes = { | |
... | |
} | |
render() { | |
return ( | |
// The view | |
) | |
} | |
} |
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 from 'react' | |
import { connect } from 'react-redux' | |
import { mapStateToProps } from '../../selectors/personSelector' | |
import Dumb from './Dumb' | |
class SmartConnector { | |
render() { | |
return ( | |
<Dumb {...this.props} /> | |
) | |
} | |
} | |
export default connect(mapStateToProps)(SmartConnector) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment