Last active
June 9, 2021 06:14
-
-
Save akellbl4/a6d9db9ddf82f7402cb1b7c2f42be529 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, { useRouter } from 'lib/router' | |
function MyComponent() { | |
const { query } = useRouter() | |
function handleSubmit(evt) { | |
const params = new FormData(evt.currentTarget).getAll("fruits"); | |
evt.preventDefault(); | |
Router.push({ pathname, query: { ...query, params } }, { shallow: true }); | |
} | |
return <>{...}</> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment