Skip to main content

DeploymentInitialized

Renders its children only after the deployment configuration has been successfully loaded. Returns null during loading to prevent flash of unstyled content.
import { DeploymentInitialized } from "@wacht/nextjs";

export default function App() {
  return (
    <DeploymentInitialized>
      <YourAppContent />
    </DeploymentInitialized>
  );
}

Prevent FOUC

import { DeploymentInitialized, DeploymentInitializing } from "@wacht/nextjs";

export default function Root() {
  return (
    <>
      <DeploymentInitializing>
        <LoadingScreen />
      </DeploymentInitializing>
      <DeploymentInitialized>
        <App />
      </DeploymentInitialized>
    </>
  );
}

Params

children
ReactNode
Content to render after deployment loads.