我想做一個簡單的React-Redux項目。我從github導入了一個項目,並開始在App.js中做一些調整。但是當我嘗試運行index.html文件時,bundle.min.js不會獲取更新並顯示舊結果。每次我對組件進行任何更改時,我都無法更新bundle.min.js文件。我正在附加我的代碼片段。bundle.min.js沒有在React項目中得到更新
index.html文件
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>React Webpack</title>
</head>
<body>
<div id="root"></div>
<script src="js/bundle.min.js"></script>
</body>
</html>
App.js
import React from 'react'
require('../../scss/style.scss');
const App =() =>(
<div>
<h2>
Username list
</h2>
<hr/>
<h2>
User Details
</h2>
</div>
);
export default App;
減速器user.js的
export default function() {
return [
{
id: 1,
first: "Bucky",
last: "Roberts",
age: 71,
description: "Bucky is a React developer and YouTuber",
thumbnail: "http://i.imgur.com/7yUvePI.jpg"
},
{
id: 2,
first: "Joby",
last: "Wasilenko",
age: 27,
description: "Joby loves the Packers, cheese, and turtles.",
thumbnail: "http://i.imgur.com/52xRlm8.png"
},
{
id: 3,
first: "Madison",
last: "Williams",
age: 24,
description: "Madi likes her dog but it is really annoying.",
thumbnail: "http://i.imgur.com/4EMtxHB.png"
}
]
}
我應該得到兩個標題說:「用戶名列表」和「用戶詳細信息」,但我得到的東西完全不同
我解決它通過安裝的WebPack,然後運行該評論的WebPack。每次我更改任何代碼時,我都必須這樣做。 – ApurvG