React 101 ก้าวแรกสู่ Front-End Developer (React Components, Props, State, Hook and calling REST API)

Software Installation

เริ่มต้นเขียน React

npx create-react-app react-basic
cd react-basic
npm start
http://localhost:3000

MyBar Component

MyBar Component

MyCard Component

MyCard Components

React Props

ที่บรรทัดที่ 13-17
name={data[0].name}
name คือ ชื่อของ attribute ที่ส่งค่าไป
{data[0].name} คือ ค่าที่ส่งเข้าไปกับ attribute
ที่บรรทัดที่ 8-11
{props.title}
หลัง props. ที่เป็น title คือชื่อ attribute ที่ส่งมา
{props.title} จึงเป็นค่าของ attribute title ที่ส่งมา
Card Components using data from json
Card Components using all data from json

React State, Hook and calling REST API

--

--

Lecturer at Digital Innovation Technology, Rangsit University

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store