Adding reflectToAttribute to the demo doesn't work
See original GitHub issue static get properties() {
return {
foo: String,
bar: Number,
whales: { type: Number, reflectToAttribute: true }
}
}
whales: 🐳🐳🐳🐳🐳🐳🐳
$0.whales
7
$0.getAttribute("whales")
"0"
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Adding reflectToAttribute to the demo doesn't work #10 - GitHub
@blikblum Here's how you can implement basic reflection (proof of concept, won't work with inherited properties). _shouldRender(props, changedProps ...
Read more >setAttribute() doesn't work the way I expect it to - Stack Overflow
Documentation says this: Using setAttribute() to modify certain attributes, most notably value in XUL, works inconsistently, as the attribute ...
Read more >Web Components API: Definition, Attributes And Props
Reflecting properties to attributes (and vice-versa). In some way, we have already described the relation between properties and attributes. Properties are the ...
Read more ><input>: The Input (Form Input) element - HTML
The <input> HTML element is used to create interactive controls for web-based forms in order to accept data from the user; a wide...
Read more >Proxy and Reflect - The Modern JavaScript Tutorial
A Proxy object wraps another object and intercepts operations, like reading/writing properties and others, optionally handling them on its ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is by design. With LitElement we explicitly wanted to make “properties” less powerful and more straightforward.
Property defaults should be set in the standard way, in the constructor. This is generally better for performance.
We also elected not to support
observers
orreflectToAttribute
fromPolymerElement
instead preferring users to write this pretty standard code explicitly.Where in a heaven are these documented? I was breaking my head 😦