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 component and parent access to scope #1151

Merged
merged 2 commits into from
Apr 28, 2020
Merged

Conversation

jstarry
Copy link
Member

@jstarry jstarry commented Apr 27, 2020

Problem

It's not possible for a component to know what other components it's nested inside of. This is an important feature for use_context hooks which need to reference the context in parent components.

Changes

  • Add get_parent and get_component methods to Scope (ComponentLink)
  • Add AnyScope type to reference parent scopes

Fixes: #1128

@jstarry jstarry merged commit 9c09515 into yewstack:master Apr 28, 2020
@jstarry jstarry deleted the parent-scope branch April 28, 2020 12:33
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.

Add the ability to walk up the component tree
1 participant