Stencil version:
@stencil/[email protected]
I'm submitting a:
Current behavior:
With this code:
children[i].style.display = 'none';
I had this error: Property 'style' does not exist on type 'Element'.
Expected behavior:
The code
children[i].style.display = 'none';
shouldn't be an error.
Steps to reproduce:
Related code:
children[i].style.display = 'none';
Other information:
I fixed with:
children[i]['style'].display = 'none'; no error.
I think the problem is in a kind of declaration file of typescript.
Well... it gives an error if children has type Element[], just cast it to HTMLElement
(children[i] as HTMLElement).style.display = 'none';
I would not consider this a stencil error, since the types for the DOM API are provided by TS itself
Ok thank you very much
@henrykode what is the solution of this error? i have also same problem
@sureshokp try the solution of manucorporat, it works for me.
Stencil version:
@stencil/[email protected]I'm submitting a:
- [x] bug report
- [ ] feature request
- [ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or https://stencil-worldwide.slack.com
Current behavior:
With this code:children[i].style.display = 'none';I had this error: Property 'style' does not exist on type 'Element'.
Expected behavior:
The codechildren[i].style.display = 'none';shouldn't be an error.
Steps to reproduce:
Related code:
children[i].style.display = 'none';Other information:
I fixed with:children[i]['style'].display = 'none'; no error.I think the problem is in a kind of declaration file of typescript.
Yep. This worked for me.
Most helpful comment
Well... it gives an error if children has type Element[], just cast it to HTMLElement
I would not consider this a stencil error, since the types for the DOM API are provided by TS itself