title: How to get payload in component in redux?
body: <pre><code>    import React from 'react';
      import './search.styles.scss';
      import { connect } from 'react-redux';
      import { setSearchField } from '../../redux/search/search.actions';
      import { combineReducers } from 'redux';
  
      class Search extends React.Component{
          render(){
              const { onSetSearchField, search } = this.props;
              return (
                  &lt;div className="search-container"&gt;
                  &lt;p&gt;user: {search}&lt;/p&gt;
                      &lt;input className="search-box" type="text" onChange={onSetSearchField} /&gt;
                  &lt;/div&gt;
              )
          }
      } 
  
      const mapDispatchToProps = (dispatch) =&gt; {
          return {
              onSetSearchField: (event) =&gt; dispatch(setSearchField(event.target.value))
          }
      }
  
      const mapStateToProps = (state) =&gt; {
          console.log(state.search, "-----------")
          if(state.search === "user:"){
              alert(state.search)
          }
          return {
              search: state.search
          }
      }
  
      export default connect(mapStateToProps, mapDispatchToProps)(Search);
  </code></pre>
  
  <p>reducer:</p>
  
  <pre><code>    const initialStateSearch = {
          search: null
      }
  
      export const getSearchType = (state=initialStateSearch, action={}) =&gt; {
          switch (action.payload) {
              case 'user':
                  return Object.assign({}, state, {search: action.payload})
              case 'post':
                  return Object.assign({}, state, {search: action.payload})
              default:
              return state
          }
      }
  </code></pre>
  
  <p>action:</p>
  
  <pre><code>    import { SearchActionTypes } from './search.types';
  
          export const setSearchField = (text) =&gt; ({
              type: SearchActionTypes.SEARCH_START,
              payload: text
          })
  </code></pre>
  
  <p>Here I'm adding search functionality using react and redux 
  But when I'm checking my payload in the reducer. It is coming but it is not coming in my search component.</p>
  
  <p>I am alerting and trying to alert and display the text on a p tag </p>
  
  <p>Please have a look</p>