Skip to content

Is there any way to bind a state value and a bindable value in the same time in a component? #15006

Answered by david-plugge
tan-zhiheng asked this question in Q&A
Discussion options

You must be logged in to vote

Runes or signals in general are not designed for two way bindings. You want to have a single source of truth. You can take a look at how bits-ui does it using a box: https://github.com/huntabyte/bits-ui/blob/edc7eba4f47d8be1643f2ef590c9196b649c6686/packages/bits-ui/src/lib/bits/select/components/select.svelte#L33

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@tan-zhiheng
Comment options

Answer selected by tan-zhiheng
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