บทความ

create react app

รูปภาพ
create react app gcreate-react-app my-app create-react-app : คำสั่งสร้าง project my-app : ชื่อ project  create-react-app TheFirstProject create-react-app helloworld เเส็จ cd my-app npm start cd my-app : เข้า my-app folder  npm start : Run react project port:3000 http://localhost:3000/

react install

รูปภาพ
react install npm install -g create-react-app ของผมติดตั้งแล้วถึงขึ้นอัพเดทเเทน

map()

รูปภาพ
map() สร้าง array ใหม่ตามเงื่อนไขที่ต้องการโดยรับ array เก่าเข้ามา

Destructuring

รูปภาพ
Destructuring การสร้าง array of array ex.

The Spread & Rest Operator

รูปภาพ
The Spread & Rest Operator การ copy array โดยใช้ ... ตัวอย่าง การ copy array a => b

class

รูปภาพ
class โครงสร้าง attribute/property : คุณลักษณะหรือตัวแปลที่เก็บใน class นั้นๆ  method : operator ที่ใช้ในการการะทำกับ attribute/property การเรียกใช้ เหมือน Java ต่างตรงที่ เพิ่ม const การสือทอด โดยใช้คำสั่ง extends เช่น nineTailCat extends Monster แมวเก้าหางเป็นมอนเตอร์ ถ้าไม่เข้าใจก็ต้องมีพื้นฐาน Java ก่อนสักนิด ตัวอย่าง การสือทอด ความต่าง เลือกใช้ตามสบายจากตัวอย่าง

import & export

รูปภาพ
import & export import : การนำเข้า ไฟล์ต่างๆ ที่ต้องการ export : ส่งออก ใน react คือการส่ง class ในไฟล์นั้นๆ ไปใช้ ตัวอย่าง Person.js ตัวอย่าง Test.js ตัวอย่างการ import ตัวอย่างการเรียกใช้