Header focus

This commit is contained in:
2021-12-26 16:51:35 +01:00
parent a80d747881
commit 97abf2c367
2 changed files with 13 additions and 6 deletions

View File

@ -1,11 +1,11 @@
import { useRef, useState } from "react";
import { MutableRefObject, useRef, useState } from "react";
import REPLInput from "./REPLInput";
import REPLHistory from "./REPLHistory";
import styles from "../../styles/REPL/REPLComplete.module.css";
import type { NextPage } from "next";
const REPL = () => {
const REPL: NextPage<{inputRef: MutableRefObject<HTMLInputElement|undefined>}> = ({ inputRef }) => {
const [history, manipulateHistory] = useState<string[]>([]);
const inputRef = useRef<HTMLInputElement>();
const onCommandExecuted = (result: string[]) => manipulateHistory(result.reverse().concat(history).slice(0, 1000));
const onClearHistory = () => manipulateHistory([]);