Code: Select all
npx create-react-app my-app
cd ./my-app
npm uninstall react react-dom
npm install react@18 react-dom@18
npm install web-vitals
Jedenfalls habe ich es erstellt und npm start ausgeführt. Die Standardeinstellung ist hier, aber jedes Mal, wenn ich etwas ändere, muss ich npm start von vorne ausführen, damit dies funktioniert, und ich weiß nicht, wie ich das beheben kann.
Ich arbeite daran wsl, das ist meine App.js:
Code: Select all
import './App.css';
function App() {
return (
Hello
);
}
export default App;
Code: Select all
React App
You need to enable JavaScript to run this app.
Code: Select all
{
"name": "hemiflixweb",
"version": "0.1.0",
"private": true,
"dependencies": {
"cra-template": "1.2.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-scripts": "5.0.1",
"web-vitals": "^4.2.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
Es zeigt nicht einmal Anzeichen dafür, dass es weiß, dass etwas aktualisiert wurde. Wenn ich beispielsweise meinen Code ausführe, erhalte ich diese Zeilen:
Code: Select all
Compiled successfully!
You can now view hemiflixweb in the browser.
Local: http://localhost:3001
On Your Network: http://172.19.104.57:3001
Note that the development build is not optimized.
To create a production build, use npm run build.
webpack compiled successfully
Weiß nicht, was das bedeutet, aber offen für Vorschläge.