SolidJSS
SolidJS7mo ago
4 replies
FatFreeButter

Pass props to component via navigation

I am building the registration flow of an application.

/register
captures email + password
/verify captures the verification code that was sent via email

Currently I am navigating to /verify via

const navigate = useNavigate();
navigate("/verify");


The component which backs /verify is currently defined as such

export default function VerifyEmail(props: {email: string}) {
  // component definition
}


What is the best way to pass
email
from
/register
to /verify?

I saw it is possible to use path params as such:

const params = useParams();
params.email


but I would rather not have my URL look like this: mywebsite.com/verify/some_user@gmail.com

Is there a way to pass
email
in as props?
Was this page helpful?