import React, { useState, useEffect } from "react"; import { Template } from "interface/template"; export default new Template( ({ }) => { const [text, setText] = useState(""); const fullText = "404 - 页面不见了 :("; const typingSpeed = 100; useEffect(() => { let currentIndex = 0; const typingEffect = setInterval(() => { if (currentIndex < fullText.length) { setText(fullText.slice(0, currentIndex + 1)); currentIndex++; } else { clearInterval(typingEffect); } }, typingSpeed); return () => clearInterval(typingEffect); }, []); return (

{text} |

抱歉,您访问的页面已经离家出走了

); });