Skip to content

Commit

Permalink
Update example
Browse files Browse the repository at this point in the history
  • Loading branch information
HaNdTriX committed Nov 5, 2020
1 parent df13bfb commit 68b8f52
Show file tree
Hide file tree
Showing 6 changed files with 632 additions and 380 deletions.
5 changes: 4 additions & 1 deletion example/babel.config.js
Expand Up @@ -7,7 +7,10 @@ module.exports = {
{
"preset-env": {
targets: {
electron: devDependencies.electron.replace(/^\^|~/, ""),
// Babel Env needs to upgrade electron-to-chromium
// for the following line to work with electron > 7:
// electron: devDependencies.electron.replace(/^\^|~/, ""),
electron: 7,
},
},
},
Expand Down
3 changes: 3 additions & 0 deletions example/main/index.js
Expand Up @@ -17,6 +17,9 @@ app.on("ready", async () => {

// Load renderer using a custom protocol:
mainWindow.loadURL("next://app");

// You can load deeplinks too (e.g: pages/about):
// mainWindow.loadURL("next://app/about");
});

// Quit the app once all windows are closed
Expand Down
6 changes: 3 additions & 3 deletions example/package.json
Expand Up @@ -17,9 +17,9 @@
},
"devDependencies": {
"concurrently": "^5.3.0",
"electron": "^10.1.3",
"electron-builder": "^22.8.1",
"next": "^9.5.3",
"electron": "^10.1.5",
"electron-builder": "^22.9.1",
"next": "^10.0.2-canary.0",
"react": "^16.13.1",
"react-dom": "^16.13.1"
},
Expand Down
4 changes: 3 additions & 1 deletion example/pages/about.js
Expand Up @@ -6,7 +6,9 @@ export default function AboutPage() {
<h1>About Page</h1>
<ul>
<li>
<a href="/">Index</a>
<Link href="/">
<a>Index</a>
</Link>
</li>
</ul>
</>
Expand Down
7 changes: 5 additions & 2 deletions example/pages/index.js
@@ -1,4 +1,5 @@
import { useState, useEffect } from "react";
import Link from "next/link";

export default function IndexPage() {
const [input, setInput] = useState("");
Expand Down Expand Up @@ -34,10 +35,12 @@ export default function IndexPage() {

<ul>
<li>
<a href="/about">About</a>
<Link href="/about">
<a>About</a>
</Link>
</li>
<li>
<a href="/invalid">Invalid</a>
<a href="/invalid">Invalid (triggers 404)</a>
</li>
</ul>
</>
Expand Down

0 comments on commit 68b8f52

Please sign in to comment.