I need redirect page after it load and get param from URL. I can do by button click. But how I can make page redirect automatic after page have get param from URL (without user input)?

Thanks!

```
const handleClick = async (event) => {
  const stripe = await stripePromise;
  const { error } = await stripe.redirectToCheckout({
    param,
  });
}

const param = new URLSearchParams(window.location.search).get('param');

const Page = () => {
  React.useEffect(() => {
    window.scrollTo(0, 0);
  }, []);
  return (
    <section >

      <button role="link" onClick={handleClick}>
      Press
    </button>

    </section>
  );
};

export default Page;

```