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

Unknown prop using export let and export function #4323

Closed
frederikhors opened this issue Jan 26, 2020 · 2 comments · Fixed by #4454
Closed

Unknown prop using export let and export function #4323

frederikhors opened this issue Jan 26, 2020 · 2 comments · Fixed by #4454
Labels

Comments

@frederikhors
Copy link

Maybe a bug in this REPL: https://svelte.dev/repl/79aa242f7e6d4af684099868189d3cb4?version=3.18.0

If you click on button "toggle modal" in console you should have this warning:

"<Form> was created with unknown prop 'saveForm'"

If you remove from Form.svelte

  • the line: export let removeThis = null
  • and the line: {removeThis}

the warning disappear.

Am I wrong?

@antony
Copy link
Member

antony commented Jan 28, 2020

This looks like a bug, since saveForm is indeed declared, and removeThis should have no bearing on it. I'm going to mark it as such.

However, if you're trying to bind a variable through three layers of components like this I'd recommend using a store, since we're probably abusing bindings a bit using the current pattern, and that might cause unexpected results.

@antony antony added the bug label Jan 28, 2020
@mikebeaton
Copy link

Somewhat related to #4403 (comment) .

Is it really right that just two layers of bind: might (reasonably be expected to) cause unexpected results?

Naively, I think a new user would naturally expect that if nested bind works at all then it should be documented and tested and supported as working - even if it does, say, get slow at high levels of nesting, or blow up on really ridiculously large levels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants