Skip to content

How to return the state derived from $derived in Svelte 5? #15264

Answered by brunnerh
rxliuli asked this question in Q&A
Discussion options

You must be logged in to vote

In Svelte, the variables themselves are reactive and if you want a reactive object to pass around, you have to wrap the variable. Probably would not do it this way, but that is one way to do it.

Replies: 1 comment 13 replies

Comment options

You must be logged in to vote
13 replies
@brunnerh
Comment options

@rxliuli
Comment options

@rxliuli
Comment options

@brunnerh
Comment options

Answer selected by rxliuli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants