setTimeout in RSC
Unanswered
Cape lion posted this in #help-forum
Cape lionOP
I want to create a intermediary page for outgoing links from my website, and I have the following code for it:
What's the recommended way to set a timeout like this in an RSC? Normal
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