You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Breaking changes to improve state transparency and prepare for the async
experimental runtime.
**`useRiveFile`** error is now `Error` instead of `string`, and
`riveFile` is `undefined` while loading (was `null`). `isLoading` is
kept for convenience. Migration: `{error}` in JSX → `{error.message}`,
and if checking `riveFile` type, `null` now means error not loading.
**`useViewModelInstance`** returns `{ instance, error }` discriminated
union instead of `ViewModelInstance | null`. Now accepts `undefined`
source so you can pass `useRiveFile().riveFile` directly:
- `{ instance: undefined, error: null }` — loading (source not ready)
- `{ instance: ViewModelInstance, error: null }` — success
- `{ instance: null, error: null }` — resolved, no ViewModel
- `{ instance: null, error: Error }` — lookup failed
`required: true` throws on `null` but not `undefined` (loading).
Migration: `const vmi = useViewModelInstance(file)` → `const { instance,
error } = useViewModelInstance(file)`.
**`useRiveNumber/String/Boolean/Color/Enum` hooks** start as `undefined`
instead of reading `property.value` synchronously. The real value
arrives via the listener's first emission.
0 commit comments