久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

如何將 React Router 與 Electron 一起使用?

How to use React Router with Electron?(如何將 React Router 與 Electron 一起使用?)
本文介紹了如何將 React Router 與 Electron 一起使用?的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

問(wèn)題描述

使用 這個(gè)樣板 作為參考,我創(chuàng)建了一個(gè) 電子應(yīng)用.它使用 webpack 來(lái)打包腳本并使用 express server 來(lái)托管它.

Using this boilerplate as reference I created an Electron app. It uses webpack to bundle the scripts and express server to host it.

Webpack 配置實(shí)際上與 this 和服務(wù)器相同這個(gè).

Webpack config is practically same as this and server this.

Electron 的腳本加載:

Electron's script loads:

mainWindow.loadURL('file://' + __dirname + '/app/index.html');

并且 index.html 會(huì)加載服務(wù)器托管的腳本:

And index.html loads the script hosted by the server:

<script src="http://localhost:3000/dist/bundle.js"></script>

我運(yùn)行 electron index.js 來(lái)構(gòu)建應(yīng)用程序和 node server 來(lái)啟動(dòng)使用 webpack 捆綁腳本的服務(wù)器.

I run electron index.js to build the app and node server to start server which using webpack bundles the scripts.

它工作正常,我的 React 組件 App 已安裝.但是我如何將 react-router 集成到其中呢?

It works fine, my React component App is mounted. But how I integrate react-router into this?

我以與在瀏覽器應(yīng)用程序中相同的方式實(shí)現(xiàn)它.我收到此錯(cuò)誤:

I implemented it the same way I would in a browser app. I get this error:

[react-router] 位置/Users/arjun/Documents/Github/electron-app/app/index.html"沒(méi)有匹配任何路由

它以文件路徑為路徑.瀏覽樣板代碼并沒(méi)有幫助.我錯(cuò)過(guò)了什么?

It is taking file path as the route. Going through the boiler plate code did not help. What am I missing?

推薦答案

另一種選擇是使用 hashHistory.實(shí)際上,在您引用的回購(gòu) 您可以看到他們正在使用 hashHistory,要不要嘗試并回帖?

Another option would be to use hashHistory instead. Actually, in your referenced repo you can see that they're using hashHistory, how about trying that and posting back?

這篇關(guān)于如何將 React Router 與 Electron 一起使用?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

discord.js v12: How do I await for messages in a DM channel?(discord.js v12:我如何等待 DM 頻道中的消息?)
how to make my bot mention the person who gave that bot command(如何讓我的機(jī)器人提及發(fā)出該機(jī)器人命令的人)
How to fix Must use import to load ES Module discord.js(如何修復(fù)必須使用導(dǎo)入來(lái)加載 ES 模塊 discord.js)
How to list all members from a specific server?(如何列出來(lái)自特定服務(wù)器的所有成員?)
Discord bot: Fix ‘FFMPEG not found’(Discord bot:修復(fù)“找不到 FFMPEG)
Welcome message when joining discord Server using discord.js(使用 discord.js 加入 discord 服務(wù)器時(shí)的歡迎消息)
主站蜘蛛池模板: 久久久一区二区 | 亚洲国产精品福利 | 日韩免费高清视频 | 天天插天天操 | 成人在线看片 | 欧美精品福利 | 亚洲一区二区三区桃乃木香奈 | 日日操av| 欧美理论片在线 | 国产精品久久久久久久久免费 | 国产黄色大片 | 中文在线一区二区 | 欧美一区二区免费 | 99精品久久 | 午夜天堂精品久久久久 | 男女免费观看在线爽爽爽视频 | 日韩中文字幕在线观看 | 国产乱码精品一区二区三区中文 | 日韩欧美不卡 | 亚洲性爰| 欧美激情欧美激情在线五月 | 久久er精品 | 黄色在线观看网站 | 久草视频观看 | 欧美一级免费看 | 欧美日韩精品亚洲 | 久草久草久草 | 国产a区 | 日本视频在线播放 | 羞羞视频免费在线观看 | 国产精品美女久久久久久久久久久 | 亚洲精品乱码久久久久久黑人 | 婷婷色成人 | 亚洲免费视频网站 | 亚洲免费视频在线观看 | 在线激情视频 | 拍真实国产伦偷精品 | 国产精品久久久久久网站 | 国产精品视频不卡 | 国产精品福利在线 | 欧美日韩成人影院 |