diff --git a/src/components/Terminal.tsx b/src/components/Terminal.tsx index b2046ca..71a05fb 100644 --- a/src/components/Terminal.tsx +++ b/src/components/Terminal.tsx @@ -8,7 +8,10 @@ export const Terminal = (props: { }) => { const terminalRef = useRef(null); - const [size, setSize] = useState<{ cols: number; rows: number }>(); + const [size, setSize] = useState<{ cols: number; rows: number }>({ + cols: -1, + rows: -1, + }); useEffect(() => { const precision = 300; @@ -55,7 +58,7 @@ export const Terminal = (props: { )} style={{ backdropFilter: "blur(2px)" }} > - {size && props.children} + {size.cols > -1 && props.children} ); diff --git a/src/components/Text.tsx b/src/components/Text.tsx index 6fae73d..d7c659f 100644 --- a/src/components/Text.tsx +++ b/src/components/Text.tsx @@ -21,4 +21,3 @@ export const Text = (props: { {props.children} ); - diff --git a/src/context/TerminalContext.tsx b/src/context/TerminalContext.tsx index fc5ba9c..66f4f68 100644 --- a/src/context/TerminalContext.tsx +++ b/src/context/TerminalContext.tsx @@ -1,6 +1,6 @@ import { createContext, useContext } from "react"; -const TerminalContext = createContext<{ cols: number; height: number } | null>( +const TerminalContext = createContext<{ cols: number; rows: number } | null>( null, );