I am currently working on a form validation project using the App Router
within Next.js
.
// app/register/page.tsx
export default function Register(context: any) {
console.log("Register page", context.params, context.searchParams);
return (
<form method={'POST'} action={'/register'} >
<input name="usr"/>
<input name="pwd"/>
<button type={'submit'}>Submit</button>
</form>
);
}
I'm trying to figure out how to retrieve the data sent by the user through POST
, but it appears that I can only access parameters from the URL using context.searchParams
and context.params
.
Any suggestions on what steps I should take next?
Thanks for your help!