Router Loader

Sometimes, it can take some time to load a route, especially if you're hitting a cold function. To improve the user experience, it can be useful to display a loading spinner while the route is being loaded.

Makerkit provides the AppRouteLoadingIndicator component, which will automatically show up when a route is being loaded. Once the route is fully loaded, the spinner will disappear.

To add it to your application, simply add it to _app.tsx:

// import the component
import AppRouteLoadingIndicator from '~/core/ui/AppRouteLoadingIndicator';

// add it to your render function
<AnalyticsTrackingEventsProvider>
  <AppRouteLoadingIndicator>
    Loading. Please Wait...
  </AppRouteLoadingIndicator>

  <Component {...pageProps} />
</AnalyticsTrackingEventsProvider>

Stay informed with our latest resources for building a SaaS

Subscribe to our newsletter to receive updatesor