-


Product List for {this.props.name}



Download 8,6 Mb.
Pdf ko'rish
bet28/37
Sana18.01.2022
Hajmi8,6 Mb.
#383795
1   ...   24   25   26   27   28   29   30   31   ...   37
Bog'liq
Designing Applications with Spring Boot 2.2 and React JS Step-by-step guide to design and develop intuitive full stack web applications by Dinesh Rajput (z-lib.org)

Product List for {this.props.name}
   
{products.map((number, index) =>
{number}
)}
   
   
   
   );
   }
}
export default ProdosApp
In the preceding code, we rendered an array of the strings using the map() function of JavaScript. Let’s see the following output:
Figure 8.13: Rendering a product list using the array
Now, we will move one step ahead and use the data as an array of objects, and we can present this data using the table format. An array of
objects is also rendered in the same way as stated earlier, but here we will map the array to the table row and render the data in the table format.
Let’s see the following code:
import React, { Component } from ‘react’;
import ProdosTableRow from ‘./ProdosTableRow’;


import ‘./App.css’;
class ProdosTable extends Component {
   constructor(props) {
   super(props);
   this.state = {
   products: [
   {
   name: “Samsung A6 plus”,
   type: “Mobile”,
   description: “Samsung A6 plus is very nice phone with 24mp front camera”,
   brand: “Samsung”
   },
   {
   name: “Sony Bravia KLV-50W662F 50 Inch Full HD”,
   type: “Television”,
   description: “Sony Bravia is full HD tv”,
   brand: “Sony”
   },
   {
   name: “Canon EOS 1500D Digital SLR Camera”,
   type: “DSLR Camera”,
   description: “Best DSLR camera in the market”,
   brand: “Canon”
   }
   ]
   };
   }
   render() {
   return (
   
   

Download 8,6 Mb.

Do'stlaringiz bilan baham:
1   ...   24   25   26   27   28   29   30   31   ...   37




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish