ReactJS frontend use state

[Mã code 34481]
  2 Đánh giá    Viết đánh giá
 212      2225      12
Phí tải: Miễn phí
Danh mục
Thể loại
Nhóm code
Ngày đăng
17-2-2023
Loại file
Full code
Dung lượng
347 KB
Không chứa mã độc
Có demo thực tế
Có hướng dẫn cài đặt

Build app Frontend ReactJS basic, order cart, show all products divided by pagination, search like any by javascript basic


MÔ TẢ CHI TIẾT
/**
 * CALL REST-APIs UNUSED YET
 * https://github.com/DHoa0202/nodeJs-express
 */


const header = {
    method: 'GET', // *GET, POST, PUT, DELETE, etc.
    mode: 'cors', // no-cors, *cors, same-origin
    cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached
    credentials: 'same-origin', // include, *same-origin, omit
    headers: {
        'Content-Type': 'application/json'
        // 'Content-Type': 'application/x-www-form-urlencoded',
    },
    redirect: 'follow', // manual, *follow, error
    referrerPolicy: 'no-referrer', // no-referrer, *no-referrer-when-downgrade, origin, origin-when-cross-origin, same-origin, strict-origin, strict-origin-when-cross-origin, unsafe-url
    body: JSON.stringify({}) // body data type must match "Content-Type" header
}

const setHeader = (method, data) => {
    return Object.assign(header, { method, body: JSON.stringify(data) })
}

const dao = {
    get: async (url) => (await fetch(url, setHeader('GET'))).json(),
    post: async (url, data) => (await fetch(url, setHeader('POST', data))).json(),
    put: async (url, data) => (await fetch(url, setHeader('PUT', data))).json(),
    del: async (url) => (await fetch(url, setHeader('DELETE'))).json()
}

export { header };
export default dao;

ĐÃ SỬ DỤNG


adjective

đang dùng, thường dùng

 


XEM THÊM ==> Hướng dẫn cài đặt chi tiết

 

HÌNH ẢNH DEMO

reactjs,nodejs,front-end htmt css

reactjs,nodejs,front-end htmt css

Nguồn: Sharecode.vn



HƯỚNG DẪN CÀI ĐẶT
"dependencies": {
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-router-dom": "^6.8.1",
    "react-scripts": "^5.0.1",
    "sass": "^1.58.0",
    "web-vitals": "^2.1.4"
  }

``` npm i ```
``` npm start ```

<a href="http://localhost:3000">open app<a>

ap

ứng dụng

 

 
 
LINK DOWNLOAD

app-reactjs-main.zip [347 KB]

File đã kiểm duyệt
     Báo vi phạm bản quyền
Pass giải nén (Nếu có):
sharecode.vn
DOWNLOAD
(Miễn phí)
Bạn có code hay
ĐĂNG BÁN NGAY

BÌNH LUẬN


Trinh Tuan Kiet (FPL DN_K17) Trả lời Thích  002:17 - 20/4/2023
chỉ em chạy code vs em chạy lỗi hoài

ĐÁNH GIÁ


ĐIỂM TRUNG BÌNH

5
2 Đánh giá
Code rất tốt (2)
Code tốt (0)
Code rất hay (0)
Code hay (0)
Bình thường (0)
Thành viên
Nội dung đánh giá
02:16 - 20/4/2023
Code rất tốt
chỉ em chạy code vs ạ em chạy lỗi miết
16:58 - 17/2/2023
Code rất tốt
Code rất tốt và phù hợp để phát triển

 HỖ TRỢ TRỰC TUYẾN