Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
www
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PLN
www
Commits
2d582d25
Commit
2d582d25
authored
Mar 04, 2025
by
PLN (Algolia)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: Missed ref
parent
daa8c74f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
2 deletions
+31
-2
[id].js
next/pages/hydra/[id].js
+31
-2
No files found.
next/pages/hydra/[id].js
View file @
2d582d25
...
@@ -35,7 +35,7 @@ export async function getStaticPaths() {
...
@@ -35,7 +35,7 @@ export async function getStaticPaths() {
}
}
export
default
function
Hydra
({
hydraData
,
sourceCode
})
{
export
default
function
Hydra
({
hydraData
,
sourceCode
})
{
const
canvasRef
=
useRef
(
null
);
//
const canvasRef = useRef(null);
return
(
return
(
<
Layout
>
<
Layout
>
<
Head
>
<
Head
>
...
@@ -49,7 +49,7 @@ export default function Hydra({ hydraData, sourceCode }) {
...
@@ -49,7 +49,7 @@ export default function Hydra({ hydraData, sourceCode }) {
<
/h5
>
<
/h5
>
{
/* <canvas id={canvasRef}/> */
}
{
/* <canvas id={canvasRef}/> */
}
{
/* <HydraSynth width={700} height={475} */
}
{
/* <HydraSynth width={700} height={475} */
}
canvasRef
=
{
canvasRef
}
source
=
{
hydraData
.
source
}
/
>
{
/* canvasRef={canvasRef} source={hydraData.source} /> */
}
<
SyntaxHighlighter
<
SyntaxHighlighter
width
=
"64em"
width
=
"64em"
language
=
"javascript"
language
=
"javascript"
...
@@ -60,3 +60,32 @@ export default function Hydra({ hydraData, sourceCode }) {
...
@@ -60,3 +60,32 @@ export default function Hydra({ hydraData, sourceCode }) {
<
/Layout
>
<
/Layout
>
);
);
}
}
// Suggestion for later:
//
// Dynamic import with SSR disabled
// const HydraSynth = dynamic(
// () => import('../../components/hydra-view'),
// { ssr: false }
// )
//
// export default function Hydra({ hydraData, sourceCode }) {
// const canvasRef = useRef(null);
//
// return (
// <Layout>
// {/* ... rest of your component ... */}
//
// {/* Now this will only run on the client side */}
// <HydraSynth
// width={700}
// height={475}
// canvasRef={canvasRef}
// source={hydraData.source}
// />
//
// {/* ... rest of your component ... */}
// </Layout>
// );
// }
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment