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

[spike] make root optional in container #78

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

itsdouges
Copy link

Hey @bbohlender here's a quick spike to test the waters. We'd conditionally render <Root> if it's missing in what we'd consider "top level components".

Should that be all components? If you have a list that should be changed and are happy with the approach I can do it all, add tests, and get it into a mergeable state.

@@ -11,4 +11,9 @@ export function useParent(): ParentContext {
return parent
}

export function useParentOptional(): ParentContext {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could rename the other hook to useParentOrThrow and this one to useParent. Happy with whatever.

@bbohlender
Copy link
Contributor

@itsdouges thanks for the PR
it's a good start. There are a few open questions for me:

  • Root currently has a few special properties (e.g. pixelSize that would need to be present on a Container/Text now or configured through a context further up the tree)
  • Root already is a Container so </...></...> is unnecessary
  • how can we propagate the idea to vanilla uikit to ensure both have a very similar API

Would love to discuss possible solutions and consolidate ideas to solve these things :)

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.

2 participants