Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

forEach Loop in React

import React from 'react';  
     
function App() {  
     
  const myArray = ['Ranjeet', 'Adil', 'Preet'];  
    
  return (  
    <div className="container" style={{background:'red'}}>     
        <h1> Example of React Map Loop </h1>  
     
        {myArray.map(name => (  
          <li>  
            {name}  
          </li>  
        ))}  
     
    </div>  
  );  
}  
     
export default App;
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #forEach #Loop #React
ADD COMMENT
Topic
Name
8+8 =