Modern Full-Stack Development


Where the Action Is: PlayerBoard.tsx



Download 5,64 Mb.
Pdf ko'rish
bet74/107
Sana06.08.2021
Hajmi5,64 Mb.
#140576
1   ...   70   71   72   73   74   75   76   77   ...   107
Bog'liq
Modern Full-Stack Development Using TypeScript, React, Node

 Where the Action Is: PlayerBoard.tsx
The PlayerBoard component is what you see on the left-hand side of the screen and is 
where the player plays the game. It begins with some imports, as always:
import React, { CSSProperties, ReactElement } from "react";
Oh, but look, we have two new ones: CSSProperties and ReactElement. Keep those 
in mind, as we’ll see them in use soon, and I’ll explain what they’re all about then.
Before that, though, we have a series of imports, 42 of them to be precise, and that 
number should ring a bell:
import tile101 from "../../img/tile101.png";
import tile102 from "../../img/tile102.png";
...40 more...
Chapter 11   time for fun: BattleJong, the Client


320
Yes indeed, one for each image! As you’ll recall, Webpack will include our images 
as Base64-encoded strings in the final bundle and will also wrap them up in a module 
definition. That’s why we can import them here. It may seem weird to import images – 
and I’d agree it is! – but essentially, at this point, they are code, and we’ll be using them 
as such. But, before we can, we must solve for one small problem, and it’s where the d.ts 
file comes into play.

Download 5,64 Mb.

Do'stlaringiz bilan baham:
1   ...   70   71   72   73   74   75   76   77   ...   107




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