A custom react hook to check for loading, useful for showing loading screen.
import React from "react";
import { useLoading } from "aloria-ui";
export default function App() {
const [loaded] = useLoading();
if (!loaded) {
return <LoadingScreen />;
}
return <MainScreen />;
}
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
.