---
title: useInitialSetup
description: "Keeps startup loading active while game assets are prepared."
---

```tsx
import { useInitialSetup } from 'filedom';

useInitialSetup({ ready: assets !== null, error, label: 'Board assets' });

if (!assets) return null;
return <Board assets={assets} />;
```

Call it on the first render, before any early return, and render the prepared content in the same commit that passes `ready: true`. The hook holds startup readiness until `ready` is true or `error` is set; an error fails the startup instead. It runs once at startup and is not meant for loading states during play.

## Options

| Prop | Type | Default | Description |
| - | - | - | - |
| `ready` | `boolean` | - | True once preparation has completed. |
| `error?` | `unknown` | - | Preparation failure, if any. A non-null value fails startup. |
| `label?` | `string` | - | Label for the timing log, read once on mount. Default 'Game setup'. |

## Returns

Nothing (`void`).
