Skip to content

Return types of state variables with nested ref/computed properties don't match the specified type #2696

Closed Answered by posva
DanRiess asked this question in Help and Questions
Discussion options

You must be logged in to vote

The problem comes the casting on the ref being wrong. refs auto unwrap nested refs (and computed, etc). Once the ref is properly typed, type errors go away

Note that putting a computed/ref within the nested data can create issues during SSR because it allows the data source to be duplicated during serialization.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@DanRiess
Comment options

@posva
Comment options

posva Jul 1, 2024
Maintainer

Answer selected by posva
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #2695 on June 15, 2024 07:55.