Skip to content

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.

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 :)

@bbohlender
Copy link
Contributor

going to close this, as its already part of the uikit 1.0 roadmap

@bbohlender bbohlender closed this May 5, 2025
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