Next.js Discord

Discord Forum

Loading page causing page refresh

Unanswered
Spectacled bear posted this in #help-forum
Open in Discord
Spectacled bearOP
Hi, im using a server component, upon a condition im redirecting the user to home page. The user is getting redirected but causing the page to refresh. If i remove the loading page, this issue is not coming. Any idea?


Loading page
const Loading = () => {
return <p>jhs</p>
}

export default Loading

file content

const BlogPage = async (props) => {
const { slug } = props.params

const blog = await getBlog(slug)

if (!blog) redirect('/')

return <MyComp />
}
>

1 Reply

Spectacled bearOP
Bump