title: React Redux ->How can I map over my state?
body: <p>So I am making a to-do list in React in order to learn redux and I've been wondering how can I use something like the map function to map over the state, so that I can show the data stored within in different divs?
  here's my initialState:</p>
  <pre><code>const tasks=
  [
      
  ]
  </code></pre>
  <p>And then there's my reducer:</p>
  <pre><code>    const taskReducer = (state=tasks,action) =&gt;
  {
      switch(action.type){
          case 'addTask':
              return[
                  ...state, 
                 { 
                  id: nextToDo+=1,
                  text: action.text,
                  completed: false
                  }
              ]
          default:
              return state;
      }
  
  }
  </code></pre>
  <p>What I want to do is something among the lines of:</p>
  <pre><code>{tasks.map(task=&gt;
  &lt;div&gt;
     &lt;h1&gt;{task.text}&lt;/h1&gt;
  &lt;div&gt;)}
  </code></pre>
  <p>But it doesn't really work, what are some ways I can accomplish this?</p>