Understanding composeContextScopes #2304
Replies: 2 comments
-
the
Not sure I follow, can you explain? |
Beta Was this translation helpful? Give feedback.
-
I am probably just hung up on "how its done in the docs" versus how you could do it. Maybe a better example would be a dialog. It's great that you can declare a dialog like this: <Dialog.Root>
<Dialog.Trigger asChild>
<button className="Button violet">Edit profile</button>
</Dialog.Trigger>
<Dialog.Portal>
<Dialog.Overlay className="DialogOverlay" />
<Dialog.Content className="DialogContent"> (Where the button trigger is declared under the dialog.) But that is just for convenience and there is nothing wrong with passing |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
My most fundamental question is probably somewhere along the lines of "Can I use
CollapsibleContent
independent of a parentCollapsible
?" More broadly I've encountered a few situations where I've wanted to separate the "trigger" from the "primitive" but (being a newb) not sure I've fully grasped the best way to do that.However, I think fundamental to all of that is the whole
createContextScope
,createContext
, anduse[Composed]Context
pattern.Does anyone have an explainer they could point me to to better understand what is going on with that pattern? (Any tips for how to use the
createCollapsibleScope
like a pro?)Beta Was this translation helpful? Give feedback.
All reactions