Skip to content

Instantly share code, notes, and snippets.

@christiannaths
Last active February 13, 2017 23:57
Show Gist options
  • Select an option

  • Save christiannaths/c47ec47db3def6fb98882a8b5c44cbc2 to your computer and use it in GitHub Desktop.

Select an option

Save christiannaths/c47ec47db3def6fb98882a8b5c44cbc2 to your computer and use it in GitHub Desktop.
my-app/src/components/user-settings.js
import React from 'react'
import { connect } from 'react-redux'
import { actions } from '../store/actions'
const mapStateToProps = (state) => ({
notificationsState: state.settings.notifications ? 'on' : 'off'
})
const NotificationsSelect = ({notificationsState}) => (
<div>
<p>
Notifications are { notificationsState }
</p>
</div>
)
export default connect(mapStateToProps)(NotificationsSelect)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment