title: React-Redux: visualize elements array
body: <p>I'm learning to use react and redux.</p>
  
  <p>So I have a little bit of questions: </p>
  
  <p>I have structured in this way: </p>
  
  <p><strong>reducers.js</strong></p>
  
  <pre><code>const initialState = {
      meetings: []
  }
  
  export const reducer = (state = initialState, action) =&gt; {
      switch(action.type){
          case 'MEETINGS_LIST':
              return [...state.meetings, action.meetings];
          default: 
              return state;
      }    
  }
  export default reducer;
  </code></pre>
  
  <p><strong>action.js</strong></p>
  
  <pre><code>export const meetingsList = (meeting) =&gt; {
      return(dispatch) =&gt; {
          fetch(`https://jsonplaceholder.typicode.com/users`)
          .then(
              res =&gt; res.json(),
              error =&gt; console.log('An error occurred.', error))
          .then(meetings =&gt; {
              dispatch({
                  type: 'MEETINGS_LIST',
                  meetings: meetings
              })
          })
      }
  }
  </code></pre>
  
  <p>It's right to do the fetch in the actions.js? Or I should do in the reducers?</p>
  
  <p>Anyway my problem is in main page,</p>
  
  <pre><code>class MeetingsList extends Component {
      constructor(props){
          super(props);
          this.state = {}
      }
  componentDidMount(){
      this.props.meetingsList();
  }
  
  
  render(){
      console.log(this.props.meetings)
      return(
          &lt;div&gt;
  
          &lt;/div&gt;
      )
  }
  }
  
  function mapStateToProps(state){
      return {meetings: state}
  };
  
  function mapDdispatchToProps(dispatch){
      return {
          meetingsList: (meetings) =&gt; dispatch(meetingsList(meetings))
      }
  }
  
  export default connect(mapStateToProps, mapDdispatchToProps)(MeetingsList)
  </code></pre>
  
  <p>I would like to print the contents of the props on the screen. It is an array [10], I had thought of using a map to be able to print every single array, but every time I try it tells me that it is impossible to use the map of an undefined. How can I do?</p>
  
  <p>Thanks</p>