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

add $$host #4534

Closed
wants to merge 2 commits into from
Closed

add $$host #4534

wants to merge 2 commits into from

Conversation

tanhauhau
Copy link
Member

Fixes #3091

  • compile error if using $$host without using customElement: true

@wyozi
Copy link

wyozi commented May 16, 2020

Is there a strong reason to restrict $$host to just custom elements? I admit the usecases for it outside custom elements may be few, but I have one: a wrapper component for testing components that rely on context. The test wrapper component will wrap a provided with a context, while also passing rest of the props/callbacks from the host to the wrapped component using the $$host reference.

Accessing the host component is doable with get_current_component, but a stable non-internal API wouldn't hurt.

@stale
Copy link

stale bot commented Jun 26, 2021

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale-bot label Jun 26, 2021
@stale stale bot removed the stale-bot label Jun 26, 2021
@stale stale bot removed the stale-bot label Jun 27, 2021
@baseballyama baseballyama added this to the 4.x milestone Feb 26, 2023
@dummdidumm dummdidumm modified the milestones: 4.x, one day Apr 11, 2023
@tronicboy1
Copy link

This change is really cool! If I am correct it will give use access to this of the custom element eh?

Very exciting and thank you for this!

@Rich-Harris
Copy link
Member

Closing as it appears we ultimately decided against this. I've just opened #11022 though

@Rich-Harris Rich-Harris closed this Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

$$host (or some way to access custom element instance)
7 participants