title: How to use map function for hooks useState properties
body: <p>I tried to use map function for looping my list data in react-hooks useState but I stuck with an error that "TypeError: Cannot read property 'map' of undefined"</p>
  
  <pre><code>//1.Initial declaration
  const App = props=&gt;  {
  const [state, changeState]= useState ({
      name:"",
      eventTitle:"",
      details:"",
      objdata:{},
      list:[],
      toggleIndex:"",
      editName: "",
      editEventTitle: "",
      editDetails: "",
      editObj: {}
  });
  
  
  //2.logic comes here
  
  
  //3.tried using map
  
  
  {(state.list.map((data,id)=&gt;{
  console.log ('loop data',data)
  }))}
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/td100.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/td100.png" alt="enter image description here"></a></p>