久久r热视频,国产午夜精品一区二区三区视频,亚洲精品自拍偷拍,欧美日韩精品二区

您的位置:首頁(yè)技術(shù)文章
文章詳情頁(yè)

node.js - react應(yīng)用加了react-redux后webpack打包后頁(yè)面顯示空白,也沒(méi)有報(bào)錯(cuò)

瀏覽:128日期:2023-10-05 11:02:10

問(wèn)題描述

開(kāi)發(fā)環(huán)境用webpack-dev-server運(yùn)行是可以的,生產(chǎn)模式下打包后把文件放到tomcat下打開(kāi)首頁(yè)就是空白頁(yè)了,而且沒(méi)有報(bào)錯(cuò)node.js - react應(yīng)用加了react-redux后webpack打包后頁(yè)面顯示空白,也沒(méi)有報(bào)錯(cuò)

下面是我app.js里的代碼,如果去掉Provider,直接引入組件是可以顯示的,加上react-redux后頁(yè)面就是空白了,請(qǐng)各位幫我看看問(wèn)題

/* --- 引入切換動(dòng)畫(huà)插件 ---*/const App = ({ children, location }) => ( <p className=’routerBox’><QueueAnim> {React.cloneElement(children, {key: location.pathname})}</QueueAnim> </p>)/* --- 注冊(cè)store ---*/const store = createStore(reducer);/* --- 路由 ---*/const renders = () => { render(<Provider store={store}> <Router history={browserHistory}><Route path =’/’ component={App}> <IndexRoute component={Signin}/> <Route path=’signin’ component={Signin}/> <Route path=’index’ component={Index}/> <Route path=’modifypwd’ component={Modifypwd}/> <Route path=’userdetail’ component={Userdetail}/> <Route path=’useredit’ component={Useredit}/> <Route path=’customerItem’ component={CustomerItem}/> <Route path=’customerAdd’ component={CustomerAdd}/> <Route path=’customerDetail/:id’ component={CustomerDetail}/> <Route path=’customerWriteinto’ component={CustomerWriteinto}/> <Route path=’customerWriteintoEdit’ component={CustomerWriteintoEdit}/> <Route path=’customerTran’ component={CustomerTran}/> <Route path=’customerInto’ component={CustomerInto}/> <Route path=’customerList’ component={CustomerList}/> <Route path=’customerEdit’ component={CustomerEdit}/></Route> </Router></Provider>,document.getElementById(’appLogin’) );}renders();/* --- 監(jiān)聽(tīng)當(dāng)前狀態(tài),判斷是否重新渲染 ---*/store.subscribe(renders);

問(wèn)題解答

回答1:

已經(jīng)解決了,是路由history的問(wèn)題

回答2:

謝謝樓主,也幫我解決了問(wèn)題。

標(biāo)簽: web
相關(guān)文章:
主站蜘蛛池模板: 重庆市| 嘉义市| 扶沟县| 建昌县| 同德县| 天镇县| 康保县| 普兰店市| 岗巴县| 怀安县| 陆河县| 武鸣县| 曲阜市| 舒兰市| 巴楚县| 蒙阴县| 连南| 孙吴县| 赫章县| 密山市| 怀来县| 磐安县| 达州市| 垣曲县| 宜丰县| 藁城市| 淮安市| 鹤山市| 昌江| 北流市| 洪雅县| 拉萨市| 奈曼旗| 馆陶县| 屏东市| 大理市| 峨眉山市| 鲁甸县| 海城市| 买车| 金堂县|