Skip to content

Conversation

@mfazekas
Copy link
Collaborator

Summary

  • useRiveProperty (and all hooks using it like useRiveEnum, useRiveNumber, etc.) returned undefined on initial render even when the property had a value
  • Fixed by retrieving the property first, then initializing state with its current value

Test plan

  • Added unit tests for initial value, path changes, and instance changes
  • All tests pass

The hook initialized useState with undefined and only updated via listener callbacks which fire on changes, not on initial attachment. Now the property is retrieved first and its value is used to initialize state.
@mfazekas mfazekas marked this pull request as ready for review December 23, 2025 09:30
@mfazekas mfazekas requested a review from HayesGordon January 6, 2026 11:51
Copy link
Contributor

@HayesGordon HayesGordon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@mfazekas mfazekas merged commit 26223f2 into main Jan 6, 2026
7 checks passed
@mfazekas mfazekas deleted the fix-use-hook-initial-value branch January 6, 2026 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants