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

Incorrect type definition for template.host #1006

Closed
davidturissini opened this issue Jan 23, 2019 · 1 comment
Closed

Incorrect type definition for template.host #1006

davidturissini opened this issue Jan 23, 2019 · 1 comment
Assignees
Labels
typescript Typescript related bugs

Comments

@davidturissini
Copy link
Contributor

Description

https://github.com/salesforce/lwc/blob/master/packages/%40lwc/engine/types/engine.d.ts has incorrect typings for template.host

Steps to Reproduce

Create a new typescript project with LWC. Try to access this.template.host in connectedCallback

Expected:
this.template.host should be cast as either null | HTMLElement

Actual:
this.template.host is always null: https://github.com/salesforce/lwc/blob/master/packages/%40lwc/engine/types/engine.d.ts#L88

@davidturissini davidturissini added the typescript Typescript related bugs label Jan 23, 2019
@caridy caridy self-assigned this Jan 25, 2019
@caridy
Copy link
Contributor

caridy commented Jan 25, 2019

It can never be null since this is a hard reference to the host that you can disconnect.

@caridy caridy closed this as completed in ee0ad9c Jan 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
typescript Typescript related bugs
Projects
None yet
Development

No branches or pull requests

2 participants