I am trying to add a spinner loading component which the app is in loading state

Thanks for the reply, I am using the (this) keyword and it still gives me the loading indicator after the page has loading, how can I get this to indicate during the loading process?

class MyApp extends App {
  isTheAppLoading() {
    return true;
  }
  render() {
    const { Component, pageProps, shopOrigin } = this.props;
    const loading = this.isTheAppLoading();
    const loadingComponent = loading ?