Skip to content

Closing Sheet component from within a component inside the SheetContent #1790

Answered by joaom00
AbhayaShankar asked this question in Q&A
Discussion options

You must be logged in to vote

Here an example: https://codesandbox.io/s/upbeat-galileo-6rxfm7?file=/src/App.tsx

How does the Sheet component knows that the SheetClose is being called from inside the SheetContent?

because it uses context to close the sheet so it needs to be inside <Sheet /> which is the context provider

Replies: 5 comments 9 replies

Comment options

You must be logged in to vote
9 replies
@joaom00
Comment options

@joaom00
Comment options

@AbhayaShankar
Comment options

@joaom00
Comment options

Answer selected by AbhayaShankar
@AbhayaShankar
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
7 participants