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

Custom elements always get missing data warnings in dev mode #1065

Closed
Rich-Harris opened this issue Jan 2, 2018 · 0 comments · Fixed by #1154
Closed

Custom elements always get missing data warnings in dev mode #1065

Rich-Harris opened this issue Jan 2, 2018 · 0 comments · Fixed by #1154
Labels
Projects

Comments

@Rich-Harris
Copy link
Member

Because of the way custom elements work, if you have the traditional hello world component...

<h1>Hello {{name}}!</h1>

<script>
  export default {
    tag: 'my-app'
  };
</script>

...and create it like so...

document.body.innerHTML = `<my-app name='world'/>`;

...then at the time of creation, the name property is unpopulated (the callback fires immediately after construction).

In dev mode, this means you get incorrect warnings about missing properties.

@Rich-Harris Rich-Harris added the bug label Jan 2, 2018
@arxpoetica arxpoetica added this to Triage in Roadmap Jan 10, 2018
@arxpoetica arxpoetica moved this from Triage to Medium term in Roadmap Jan 10, 2018
@Rich-Harris Rich-Harris moved this from Medium term to PR'd in Roadmap Feb 4, 2018
Rich-Harris added a commit that referenced this issue Feb 9, 2018
prevent erroneous missing data warnings for custom elements
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Roadmap
  
PR'd
Development

Successfully merging a pull request may close this issue.

1 participant