diff --git a/blog/2024-11-15-playing-with-fire/src/Canvas.tsx b/blog/2024-11-15-playing-with-fire/src/Canvas.tsx index 012c540..45e0a64 100644 --- a/blog/2024-11-15-playing-with-fire/src/Canvas.tsx +++ b/blog/2024-11-15-playing-with-fire/src/Canvas.tsx @@ -1,6 +1,5 @@ import React, {useEffect, useState, createContext, useRef} from "react"; import {useColorMode} from "@docusaurus/theme-common"; -import BrowserOnly from "@docusaurus/BrowserOnly"; type PainterProps = { width: number; @@ -76,13 +75,18 @@ export const Canvas: React.FC = ({style, children}) => { } }, [painter]); - const filter = useColorMode().colorMode === 'dark' ? 'invert(1)' : ''; + const canvasProps = { + ref: canvasRef, + width, + height, + style: {filter: useColorMode().colorMode === 'dark' ? 'invert(1)' : ''} + } return ( <>
- {width > 0 ? : null} + {width > 0 ? : null}