Skip to content

Widget loader indicator #70

Answered by chybisov
Yuripetusko asked this question in Q&A
Apr 13, 2023 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

@Yuripetusko Hey 🙂 I assume you use the Widget with Next.js and dynamic import. You can show a loading indicator like this

export const LiFiWidgetNext = dynamic(
  () => import('../components/Widget').then((module) => module.Widget) as any,
  {
    ssr: false,
    // loading indicator
    loading: () => <LoadingIndicator />,
  },
);

const Home: NextPage = () => {
  return <LiFiWidgetNext />;
};

Please take a look at the updated Next.js example here https://github.com/lifinance/widget/tree/main/examples/nextjs

There is also an updated next.config.js with a simplified configuration for Next.js 13. 🙂

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Yuripetusko
Comment options

@chybisov
Comment options

Answer selected by Yuripetusko
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants