Skip to content

Instantly share code, notes, and snippets.

@jackcallister
Created September 29, 2015 13:43
Show Gist options
  • Save jackcallister/49cec90e20d51ff6b109 to your computer and use it in GitHub Desktop.
Save jackcallister/49cec90e20d51ff6b109 to your computer and use it in GitHub Desktop.
Smart Dumb Pattern
import React, { PropTypes } from 'react'
export default class Dumb {
static propTypes = {
...
}
render() {
return (
// The view
)
}
}
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