Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bind forwarding #5675

Closed
techniq opened this issue Nov 12, 2020 · 1 comment
Closed

Bind forwarding #5675

techniq opened this issue Nov 12, 2020 · 1 comment

Comments

@techniq
Copy link

techniq commented Nov 12, 2020

Describe the bug
It took me a while to determine this was the root issue, but I was expecting bindings to be forwarded/redirect to the base component when spreading the remaining props.

// App.js
<SomeComponent bind:value />

// SomeComponent.js
<BaseComponent {...$$restProps} />

// BaseComponent.js
<input bind:value />

To Reproduce
I've setup a REPL that should demonstrate the issue / feature

Expected behavior
The binded value in App.js is bound to the BaseComponent value

Information about your Svelte project:

  • Your browser and the version: Chrome 86

  • Your operating system: OS X 10

  • Svelte version: 3.29.7

Severity
The issue can be worked around by declaring a local variable within the middle "SomComponent" and binding to it (see Redirect component in REPL). Since this is a common pattern I'm using, it requires a lot of duplication and not sure if there is any side effects to this "re-binding", but can work around at the moment.

Additional context
This looks related to #5106, but smaller scope (specially about bind forwarding).

@zyxd
Copy link

zyxd commented Nov 14, 2020

Duplicate of #2226, #5137

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

No branches or pull requests

3 participants