Call data from different component using Array method | props netflix app part 2

 Call data from different component using import export method | props netflix app part 2



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)

ReactDOM.render(
  <>
  <h1 className="heading_style" > List of five cards</h1>
  <Cards
    imgsrc = {Sdata[0].imgsrc}
    title = {Sdata[0].title}
    sname = {Sdata[0].sname}
  />
 <Cards
    imgsrc = {Sdata[1].imgsrc}
    title = {Sdata[1].title}
    sname = {Sdata[1].sname}
  />
  <Cards
    imgsrc = {Sdata[2].imgsrc}
    title = {Sdata[2].title}
    sname = {Sdata[2].sname}
  />
  <Cards
    imgsrc = {Sdata[3].imgsrc}
    title = {Sdata[3].title}
    sname = {Sdata[3].sname}
  />
   <Cards
    imgsrc = {Sdata[4].imgsrc}
    title = {Sdata[4].title}
    sname = {Sdata[4].sname}
  />
  
  </>,
  document.getElementById('root')
);