cosmos-explorer/src/Explorer/Tabs/XTermComponent.tsx
Sourabh Jain 1678ec0a23 xterm add
2025-02-18 17:11:39 +05:30

17 lines
360 B
TypeScript

import React, { useEffect, useRef } from "react";
import { XTerm } from "xterm-for-react";
const XTermComponent: React.FC = () => {
const xtermRef = useRef(null);
useEffect(() => {
if (xtermRef.current) {
xtermRef.current.terminal.writeln("Hello, World!");
}
}, []);
return <XTerm ref={xtermRef} />;
};
export default XTermComponent;