Array Map Method Netflix app part 3

Array Map Method Netflix app part 3

used file:(index.js, index,css, App.js, Cards.js, Sdata.js)

Source code:-

2.index.js

import React from 'react';
import ReactDOM from 'react-dom';
import Cards from './Cards';
import Sdata from './Sdata';
console.log(Sdata[0].sname)

function ncard(val){
  return(
    <Cards
    imgsrc = {val.imgsrc}
    title = {val.title}
    sname = {val.sname}/>
  )
}

ReactDOM.render(
  <>
  <h1 className="heading_style" > List of five cards</h1>

    {/* Use map method */}
    {Sdata.map(ncard)}
  
  </>,
  document.getElementById('root')
);