Skip to content

Instantly share code, notes, and snippets.

@jorgeortega
Last active February 21, 2018 09:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jorgeortega/1f83cf6823276577ae3d3097d38bc8ab to your computer and use it in GitHub Desktop.
Save jorgeortega/1f83cf6823276577ae3d3097d38bc8ab to your computer and use it in GitHub Desktop.
React Redux Simple Container Component
import React, { Component } from 'react'
import { string } from 'prop-types'
import { connect } from 'react-redux'
import { openModal } from 'actions/modal'
import SimpleModal from './index.js'
export class SimpleModalContainer extends Component {
constructor (props) {
super(props)
}
render () {
return (
<SimpleModal />
)
}
}
SimpleModalContainer.propTypes = {
modalMessage: string
}
export const mapStateToProps = ({ modalMessage }) => ({ modalMessage })
export default connect(mapStateToProps, { openModal })(SimpleModalContainer)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment