React
Watch & HMR
Keep schema docs in sync while you develop in any React app.
Editing .prisma or .sql files sits outside most bundler module graphs, so browser HMR is not automatic unless you opt in.
Behavior
| Mode | Setup | Behavior |
|---|---|---|
| Refresh | loadCatalog(config) + dynamic server render | Reload catalog on full page refresh |
| Config edits | import ozzyrm.config.ts | Bundler HMR when the config module changes |
| Schema file HMR | watch.hot: true + ozzyrm watch | stamp bridge invalidates the docs module |
Enable watch
export default defineProject({
schemas: [
/* ... */
],
watch: {
enabled: true,
debounceMs: 200,
generateOnStart: true,
hot: true,
},
});Run the watcher beside your React app:
npx ozzyrm watch # terminal 1
# terminal 2: vite / next dev / remix vite / your React serverwatch: false disables the CLI watcher. Production loadCatalog ignores watch options.
Without the watcher, refresh the page after schema edits.
Framework notes
- Any React app: pair
ozzyrm watchwith your existingdevscript - RSC hosts (including Next.js App Router):
OzzyRMDocsFromConfigcan import the stamp whenhot: true - Client-only hosts: regenerate catalog (or call
handle.update) after watch writes new JSON
Full option reference: Watch options.