import React from 'react' import {connect} from 'react-redux' import * as actions from '../actions' import {bindActionCreators} from 'redux' import {getSelectedTags, getTagsToSelect} from '../selectors' export default class TagNavigation extends React.Component { render(){ let {tagsToSelect, selectedTags, actions: {selectTag}} = this.props return (
) } } class Tag extends React.Component { render(){ let {tag: {name, choices, number}, selectTag} = this.props return (
  • {`${name} (${number} variables)`}
  • ) } } const mapStateToProps = state => ( { selectedTags: state.selectedTags, tagsToSelect: getTagsToSelect(state) } ) const actionsToProps = dispatch => ({ actions: bindActionCreators(actions, dispatch) }) export default connect(mapStateToProps, actionsToProps)(TagNavigation)