Package
All runtime APIs are in theorg.jetbrains.compose.reload package.
Installation
Add the runtime API dependency to your project:Replace
VERSION with the current version of Compose Hot Reload.When to Use
The Runtime API is useful when you need to:- Detect hot reload status: Check if your application is running with hot reload enabled using
isHotReloadActive - React to reload events: Execute code after each hot reload using
AfterHotReloadEffectorinvokeAfterHotReload() - Manage state: Reinitialize or update state that doesn’t automatically migrate after a reload
- Integrate with external systems: Notify external tools or services when a reload occurs
- Debug reload behavior: Add logging or diagnostics around reload events
Available APIs
The Runtime API provides three main categories of functionality:Properties
isHotReloadActive
Check if the application is running with hot reload enabled
Composable Functions
AfterHotReloadEffect
Composable effect that runs after each hot reload
DevelopmentEntryPoint
Legacy entry point wrapper (deprecated)
Scope Objects
HotReloadScope
Scope for registering reload hooks outside of composable context
Platform Support
The Runtime API is multiplatform and supports:- JVM (Desktop)
- Android
- macOS (ARM64, x64)
- Linux (x64, ARM64)
- iOS (Simulator ARM64, ARM64, x64)
- WebAssembly (WASM JS)
- JavaScript
On platforms where hot reload is not available, all APIs safely no-op. The
isHotReloadActive property returns false, and registered hooks are never invoked.Usage Patterns
Basic Hot Reload Detection
Composable Effect Pattern
Non-Composable Hook Pattern
API Stability
Most Runtime APIs are marked with@DelicateHotReloadApi, indicating they should be used with caution:
Next Steps
HotReloadScope
Learn about registering reload hooks
Composable APIs
Explore composable functions and properties