title: React hooks map is not a function
body: <p>what I'm trying to do is simple. I have two buttons, one that says toggle on and one that says toggle off. When I click one of them, I want to set my state to true or false (depending on which button was clicked) and re render, using the newly set true false values. But for some reason, rows.map is not a function. Here is what I have so far:</p>
  
  <pre><code>function Calculator() {
      const [rows, setRows] = useState([
  
          {   
              rowVal: 0,
              editing: false,
              someVal: 20
          },
          {   
              rowVal: 1,
              editing: true,
              someVal: 20
          },
  
      ])
      return(
          &lt;div className="container"&gt;
              &lt;table className="table"&gt;
                  &lt;thead&gt;
                      &lt;tr&gt;
                          &lt;th className="text-center" scope="col"&gt;SomeVal&lt;/th&gt;
                      &lt;/tr&gt;
                  &lt;/thead&gt;
                  &lt;tbody&gt;
                          {
                              const togOff = &lt;button onClick={setRows({editing: false})}&gt;Toggle Off&lt;/button&gt;
                              const togOn = &lt;button onClick={setRows({editing: true})}&gt;Toggle On&lt;/button&gt;
                              rows.map(val =&gt; {
                                  if (val.editing === true){
                                      togOff
                                  } else {
                                      togOn
                                  }
                              })
                          }
  
                  &lt;/tbody&gt;
              &lt;/table&gt;
          &lt;/div&gt;
      )
  }
  </code></pre>
  
  <p>If anyone can point me in the right direction, that would be great.</p>