Skip to content

Commit

Permalink
Add loading fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
llun committed Apr 29, 2022
1 parent 7d73730 commit f450101
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pages/[[...page]].tsx
@@ -1,7 +1,8 @@
import Head from "next/head";
import { BuilderComponent, builder, Builder } from "@builder.io/react";
import { GetStaticPropsContext, InferGetStaticPropsType } from "next";
import { InferGetStaticPropsType } from "next";
import { componentRegister as backgroundComponentRegister } from "../components/Background";
import { useRouter } from "next/router";

builder.init(process.env.NEXT_PUBLIC_BUILDER_IO_KEY);

Expand All @@ -11,6 +12,11 @@ export default function Home({
page,
locale,
}: InferGetStaticPropsType<typeof getStaticProps>) {
const router = useRouter();
if (router.isFallback) {
return <h1>Loading...</h1>;
}

builder.setUserAttributes({ locale });
return (
<div className="container">
Expand Down

1 comment on commit f450101

@vercel
Copy link

@vercel vercel bot commented on f450101 Apr 29, 2022

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

builder-bug – ./

builder-bug-git-main-llun.vercel.app
builder-bug-llun.vercel.app
builder-bug.vercel.app

Please sign in to comment.