Skip to content

How to combine bindable state prop + context #15222

Open
@leekeh

Description

@leekeh

Describe the problem

I'm looking for a way to use context with a bindable prop state. The documentation describes how you need to pass a $state object to the context in order for it to be reactive. However, I would like to use a $state that is coming in as a bindable property, this does not seem to work.

Here is a REPL of the situation: https://svelte.dev/playground/86a850f39b684dbf8541d595d1f60257?version=5.19.7

Image

Describe the proposed solution

If possible, I would like bindable states to be reactive out of the box. Alternatively, it would be nice to have some documentation on how to implement this pattern.

Importance

would make my life easier

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions