Created
March 8, 2021 21:25
-
-
Save onedebos/f5efc83c3d0ff6346c4f6caf82a985a7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useState } from "react"; | |
import { useRouter } from "next/router"; | |
function MyApp({ Component, pageProps }) { | |
const [sender, setSender] = useState(""); | |
const router = useRouter(); | |
const handleLogin = (e) => { | |
e.preventDefault(); | |
router.push("/chat"); | |
}; | |
return ( | |
<Component | |
handleLoginChange={(e) => setSender(e.target.value)} | |
sender={sender} | |
handleLogin={handleLogin} | |
{...pageProps} | |
/> | |
); | |
} | |
export default MyApp; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment