Next.js Discord

Discord Forum

setTimeout in RSC

Unanswered
Cape lion posted this in #help-forum
Open in Discord
Cape lionOP
I want to create a intermediary page for outgoing links from my website, and I have the following code for it:
const RedirectPage = async ({ params }: Props) => {
  const data = await getData(params.id);

  // This should happen after 1000ms
  permanentRedirect(data.url);

  return (
    <div>{data.name}</div>
  );
};

export default RedirectPage;


What's the recommended way to set a timeout like this in an RSC? Normal setTimeout obviously doesn't work

0 Replies