Skip to content

Latest commit

 

History

History

useLoading

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

useLoading

Intro

A custom react hook to check for loading, useful for showing loading screen.

Usage

import React from "react";
import { useLoading } from "aloria-ui";

export default function App() {
  const [loaded] = useLoading();
  if (!loaded) {
    return <LoadingScreen />;
  }
  return <MainScreen />;
}

Arguments

The useLoading hook takes the following prop:

  • loadingTimeout: It specifies the time in seconds you want the loading screen to appear for. Default value: 3.