Skip to content
This repository has been archived by the owner on Oct 29, 2022. It is now read-only.

Commit

Permalink
chore: fixing next.js rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaslagoni committed May 20, 2022
1 parent 60ce720 commit ac5e3ea
Show file tree
Hide file tree
Showing 11 changed files with 10,013 additions and 737 deletions.
10,290 changes: 9,790 additions & 500 deletions examples/nextjs/package-lock.json

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions examples/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start"
"start": "next start",
"postinstall": "npm link ../../library/node_modules/react-dom ../../library/node_modules/react ../../library/"
},
"dependencies": {
"@lagoni/edavisualiser": "0.0.0",
"next": "latest",
"react": "17.0.2",
"react-dom": "17.0.2"
"@lagoni/edavisualiser": "0.13.2",
"next": "10",
"react": "^16.8.0",
"react-dom": "^16.8.0"
}
}
6 changes: 6 additions & 0 deletions examples/nextjs/pages/_app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// pages/_app.js
import "@lagoni/edavisualiser/styles/default.min.css";

export default function MyApp({ Component, pageProps }) {
return <Component {...pageProps} />
}
8 changes: 7 additions & 1 deletion examples/nextjs/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import Head from 'next/head';
import { ApplicationView, Application } from '@lagoni/edavisualiser';
// Import component using `dynamic` helper
import dynamic from 'next/dynamic';

// Import component without SSR/SSG
const ApplicationView = dynamic(() => import('@lagoni/edavisualiser/browser/ApplicationView'), { ssr: false });
const Application = dynamic(() => import('@lagoni/edavisualiser/browser/Application'), { ssr: false });

export default function Home() {
if (typeof navigator === 'undefined') return null;
return (
<div className="container">
<Head>
Expand Down
Loading

0 comments on commit ac5e3ea

Please sign in to comment.