We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
$host()
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
If you assign $host() to a variable, the assignment statement will be removed after compilation.
https://github.com/CLDXiang/svelte-custom-element-host-bug
function fail(greeting: string) { const element = $host() as HTMLElement; element.dispatchEvent( new CustomEvent('greeting', { detail: greeting }) ); }
Compilation output:
function fail(greeting) { element.dispatchEvent(new CustomEvent("greeting", { detail: greeting })); }
var element = $$props.$$host is missing.
var element = $$props.$$host
No response
System: OS: Windows 11 10.0.22631 CPU: (20) x64 13th Gen Intel(R) Core(TM) i5-13600KF Memory: 16.67 GB / 31.85 GB Binaries: Node: 20.10.0 - C:\Program Files\nodejs\node.EXE npm: 10.2.3 - C:\Program Files\nodejs\npm.CMD pnpm: 9.9.0 - C:\Program Files\nodejs\pnpm.CMD Browsers: Edge: Chromium (127.0.2651.74) Internet Explorer: 11.0.22621.3527 npmPackages: svelte: 5.0.0-next.243 => 5.0.0-next.243
annoyance
The text was updated successfully, but these errors were encountered:
2d37826
trueadm
Successfully merging a pull request may close this issue.
Describe the bug
If you assign $host() to a variable, the assignment statement will be removed after compilation.
Reproduction
https://github.com/CLDXiang/svelte-custom-element-host-bug
Compilation output:
var element = $$props.$$host
is missing.Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: