久久久久久久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í)的歡迎消息)
主站蜘蛛池模板: 婷婷综合网 | 国产精品久久久久久久毛片 | 久久久.com| 亚洲免费一区二区 | 日本免费一区二区三区四区 | 精品少妇一区二区三区在线播放 | 亚洲欧美综合精品久久成人 | 日韩免费av| 二区欧美| 久久久久国产一区二区 | 91夜夜夜| 一级毛片视频在线观看 | 网站一区二区三区 | 一区二区三区日韩精品 | 色爱综合网 | 蜜桃av一区二区三区 | 草草在线观看 | 精品日韩一区 | 在线免费观看成人 | 国产免费一区 | 欧美日韩三区 | 搞黄网站在线观看 | 一区二区三区四区不卡 | 蜜桃av人人夜夜澡人人爽 | 国产精品久久一区二区三区 | 日韩羞羞| 日韩小视频 | 91中文在线观看 | 久久视频免费看 | 欧美精品一区二区免费 | 在线观看国产wwwa级羞羞视频 | 久久亚洲精品国产精品紫薇 | 久久不卡 | 日本久久精 | 黄色在线观看国产 | 激情视频中文字幕 | 在线观看国产视频 | 视频一区在线 | 中文在线一区 | gogo肉体亚洲高清在线视 | 欧美在线色视频 |