Answers for "how do you iterate through a list in react stackoverflow"

0

how do you iterate through a list in react stackoverflow

if (this.props.dataresults.length > 0) {
         return this.props.dataresults.map(function(user, i){
               console.log('user');
               console.log(user.description);
               return <li key={i}>{user.description}</li>;
          })
     } else {
         return (<h1>No Results </h1>)
     }
Posted by: Guest on April-21-2021

Code answers related to "how do you iterate through a list in react stackoverflow"

Code answers related to "Javascript"

Browse Popular Code Answers by Language