Last active
June 9, 2021 06:16
-
-
Save akellbl4/8a9d091c0cca56aca616284a3a7eefc0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// pages/params.jsx | |
import Router from 'next/router' | |
function MyComponent() { | |
const handleClick = useCallback(() => { | |
// some logic | |
Router.push('/profile') | |
}, []) | |
useEffect(() => { | |
if (...) { | |
Router.push('/sign-in') | |
} | |
}, []) | |
return <>...</> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment