Commit 2d582d25 by PLN (Algolia)

fix: Missed ref

parent daa8c74f
......@@ -35,7 +35,7 @@ export async function getStaticPaths() {
}
export default function Hydra({ hydraData, sourceCode }) {
const canvasRef = useRef(null);
// const canvasRef = useRef(null);
return (
<Layout>
<Head>
......@@ -49,7 +49,7 @@ export default function Hydra({ hydraData, sourceCode }) {
</h5>
{/* <canvas id={canvasRef}/> */}
{/* <HydraSynth width={700} height={475} */}
canvasRef={canvasRef} source={hydraData.source} />
{/* canvasRef={canvasRef} source={hydraData.source} /> */}
<SyntaxHighlighter
width="64em"
language="javascript"
......@@ -60,3 +60,32 @@ export default function Hydra({ hydraData, sourceCode }) {
</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>
// );
// }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment