diff --git a/src/components/Container.tsx b/src/components/Container.tsx index 8bf27ea..feb8f0c 100644 --- a/src/components/Container.tsx +++ b/src/components/Container.tsx @@ -1,6 +1,6 @@ import React, { useState, useEffect, useRef, useLayoutEffect } from "react"; import { css, cx } from "@emotion/css"; -import { useHistory } from "react-router-dom"; +import { useNavigate } from "react-router-dom"; import { ReactComponent as Logo } from "../assets/logo.svg"; import { ReactComponent as Right } from "../assets/arrow-right.svg"; @@ -24,7 +24,7 @@ const Container: React.FunctionComponent<{ className, ...props }) => { - const history = useHistory(); + const navigate = useNavigate(); const mobile = useMediaQuery("(max-width: 50rem)"); @@ -109,7 +109,7 @@ const Container: React.FunctionComponent<{ document.body.style.maxHeight = "100vh"; document.body.style.overflow = "hidden"; e.currentTarget.style.width = "0"; - timer(() => next && history.push(next), 300); + timer(() => next && navigate(next), 300); }; return ( @@ -191,7 +191,7 @@ const Container: React.FunctionComponent<{ )}> (mobile ? setShowMenu(true) : history.push("/"))} + onClick={() => (mobile ? setShowMenu(true) : navigate("/"))} /> diff --git a/src/components/Dashed.tsx b/src/components/Dashed.tsx index 384c825..85e7239 100644 --- a/src/components/Dashed.tsx +++ b/src/components/Dashed.tsx @@ -1,7 +1,7 @@ import React from "react"; import { css } from "@emotion/css"; -const Dashed: React.FunctionComponent = ({ children }) => ( +const Dashed: React.FC<{ children: React.ReactNode }> = ({ children }) => ( @@ -23,9 +23,8 @@ ReactDOM.render( } /> } /> - + } /> , - document.getElementById("root"), );