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

docs: next.js page router example #265

Merged
merged 5 commits into from
Jul 4, 2024
Merged

Conversation

DNR500
Copy link
Contributor

@DNR500 DNR500 commented Jul 2, 2024

Jira: LF-9051

The added example here is intended to help share how to get the Widget working with Page Router pages and uses Next.js dynamic loading mechanicsm.

import dynamic from 'next/dynamic';

const DynamicWidget = dynamic(() => import('@/components/Widget'), {
  loading: () => <p>Loading...</p>,
  ssr: false,
});  

export default function Home() {
  return (
      <main>
        <DynamicWidget />
      </main>
  );
}

import dynamic from 'next/dynamic';

const DynamicWidget = dynamic(() => import('@/components/Widget'), {
loading: () => <p>Loading...</p>,
Copy link
Member

Choose a reason for hiding this comment

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

Can we use our Skeleton here?

Copy link
Contributor Author

@DNR500 DNR500 Jul 3, 2024

Choose a reason for hiding this comment

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

We need to do a bit of work to allow that. Looking at it now

@chybisov chybisov merged commit a68873b into main Jul 4, 2024
1 check passed
@chybisov chybisov deleted the nextjs-page-router-example branch July 4, 2024 09:46
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