Hướng dẫn primereact css not working - primereact css không hoạt động
Tôi đang làm việc trên một ứng dụng React JS, tôi đã thêm thư viện ReactbootStrap & Primereact cho kiểu dáng. Thư viện ReactbootStrap đang hoạt động tốt nhưng kiểu dáng Primereact không được áp dụng, tôi đã làm theo tất cả các bước có trong phần bắt đầu, bất cứ ai có thể gợi ý cho tôi những gì còn thiếu. Tôi đang thêm các tập tin cho sự giải quyết. Tôi đã sử dụng lệnh bên dưới để thêm các tệp trong các mô -đun nút Show
Tệp App.js
Todos.js nơi tôi đang thêm nút kiểu Primereact
Thêm gói.json để giải quyết
Thêm hình ảnh kết quả cuối cùng Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community. Sign up for a free GitHub account to open an issue and contact its maintainers and the community. Pick a username Email AddressPasswordBy clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails. Already on GitHub? Sign in to your account leejakuPosts: 5Joined: 13 Jul 2018, 13:12Posts: 5Joined: 13 Jul 2018, 13:12 Hi, I am Jake Lee. I bought Ultima Template for my project. After some modification, web style was broken. I don't know why...
I tried to solve this problem. but still stucked. When I saw some theme css. That's not CSS file, just HTML.
Can you help me? kfcsoftPosts: 4Joined: 01 Jun 2021, 13:57Posts: 4Joined: 01 Jun 2021, 13:57 06 Jul 2022, 01:11 On Windows, my project is working fine. I even correct all typescript problems. After I switch to Mac, things are not working. The style is not working at all. So I do upgrade-interative and use prime 8.2, React 18.2 and React-Dom 18.2. Fix the React Create Root stuff, Things are still not working....
React.js server & client
Cài đặt React
Cài đặt bộ cài app React: npm install -g create-react-app Tạo project React với tên
ReactMySQLProject
Phần tiếp theo bên dưới sẽ giúp kết hợp để sử dụng được API Express bên trong một project React.
Ta tiến hành cài đặt cd ../ npm install –save concurrently
/package.json {
"name": "ReactMySQLProject",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"server": "node app.js",
"client": "npm run start --prefix client",
"dev": "concurrently \"npm run server\" \"npm run client\""
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"concurrently": "^5.0.0",
"express": "^4.17.1"
}
}
/client/package.json {
"name": "client",
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^16.10.2",
"react-dom": "^16.10.2",
"react-scripts": "3.2.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"proxy": "http://localhost:4000"
}
Tới đây ta đã liên kết chạy được đồng thời Server và Client rồi (bằng cách chạy lệnh npm install -g create-react-app0), tuy nhiên chúng ta vẫn chưa liên kết dữ liệu được, xem tiếp bên dưới để xem dữ liệu được liên kết như thế nào nhé.
Ta lần lượt tiến hành các bước như sau: /app.js const express = require('express');
const app = express();
app.get('/api/test', (req, res) => {
res.json({ message: 'I am a message from Server!'});
})
app.listen(4000, () => console.log('App listening on port 4000')); Chỉnh lại nội dung file Cài đặt thư viện Axios bằng lệnh: /client/src/app.js import React, { Component } from 'react'; import logo from './logo.svg'; import './App.css'; import axios from 'axios'; class App extends Component { state = { message: '' }; componentDidMount() { axios.get('/api/test') .then(result => this.setState({ message: result.data.message })) }; render() { return( |