Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix email page suspense issue #406

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

Fix email page suspense issue #406

wants to merge 1 commit into from

Conversation

TheCactusBlue
Copy link
Contributor

@TheCactusBlue TheCactusBlue commented Jan 28, 2025

Important

Add Suspense to handle loading states in EmailsAndAuthPage and AccountSettings.

  • Behavior:
    • Wraps EmailsAndAuthPage in Suspense in AccountSettings to handle loading states.
    • Wraps PageLayout in Suspense in EmailsAndAuthPage to handle loading states.

This description was created by Ellipsis for d0f4c53. It will automatically update as commits are pushed.

Copy link

vercel bot commented Jan 28, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
stack-backend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 28, 2025 9:03pm
stack-dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 28, 2025 9:03pm
stack-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 28, 2025 9:03pm

Copy link

patched-codes bot commented Jan 28, 2025

Documentation Changes Required

packages/stack/src/components-page/account-settings.tsx

  1. Update the import statement to include Suspense from React:

    import React, { Suspense } from 'react';
  2. Wrap the AccountSettings component with a Suspense boundary:

    <Suspense fallback={<Loading />}>
      <AccountSettings />
    </Suspense>
  3. Wrap the EmailsAndAuthPage component with a Suspense boundary:

    <Suspense fallback={<Loading />}>
      <EmailsAndAuthPage />
    </Suspense>

These changes are necessary to implement lazy loading and suspense functionality for the AccountSettings and EmailsAndAuthPage components. This will improve the performance and user experience of the application by allowing these components to be loaded asynchronously.

Please ensure these changes are reflected in the relevant documentation files and any associated code examples.

Comment on lines +361 to +369
<Suspense>
<PageLayout>
<EmailsSection/>
{passwordSection}
{passkeySection}
{otpSection}
{mfaSection}
</PageLayout>
</Suspense>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at the very least, every suspense should have a fallback

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a loader/skeleton component that you want as a fallback?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants