Closed anoblet closed 5 years ago
@justinfagnani
The types in connect
mixin seems fine. I ran the typescript template of PWA Starter Kit and my-app.ts seems to compile correctly without error.
Try adding the customElement decorator to a class.
Yeah I did this:
@customElement('my-app')
export class MyApp extends connect(store)(LitElement) {
@property({type: String})
appTitle = '';
and it complied successfully without error.
You may be correct, I cannot reproduce the error on Stackblitz. I do get the error locally though with this file: https://gist.github.com/anoblet/8011f72dc8e131c56fb642b04bd68783
@anoblet Are you still having issue? If you are can you please provide a simple reproducible test on Stackblitz/Glitch/jsbin so we can take a look?
Sorry for the delay. I've stopped relying on mixins for the most part. Last time I checked, when I tried to create a repo everything worked so something must have been off on my side.
Description Some decorators, In my case 'customElement' from lit-element throw an error when using mixins.
Live Demo https://stackblitz.com/edit/lit-element-hello-world-zepmzz?file=page-one.ts
Steps to Reproduce Add customElement decorator to a class Use the connect mixin Expected Results No error
Actual Results We receive the error:
Type 'typeof MyElement' is not assignable to type 'Constructor'.
Type 'MyElement' is missing the following properties from type 'HTMLElement': accessKey, accessKeyLabel, autocapitalize, dir, and 235 more.```
Browsers Affected
Versions