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

Pass className of Gallery into the Protal #859

Open
mortyccp opened this issue May 27, 2022 · 2 comments
Open

Pass className of Gallery into the Protal #859

mortyccp opened this issue May 27, 2022 · 2 comments

Comments

@mortyccp
Copy link

Is your feature request related to a problem? Please describe.
I want to use the styled component library to style the Gallery but seem it's not working due to className of Gallery is not passed to the Portal

Describe the solution you'd like
I would like the Gallery to accept className as props and pass to the created Portal

Describe alternatives you've considered
I can style the component using global CSS.

@irudoy
Copy link
Contributor

irudoy commented May 27, 2022

Hi! The Gallery component doesn't render any DOM elements. It's just a context provider.
Photoswipe right before init appends its own elements to the body (by default). It can be controlled with appendToEl option, which you can pass using <Gallery options={{ appendToEl: yourElementRef.current }} /> prop.

@mortyccp
Copy link
Author

OK. I think that will work. But would be best if className is passed to slideContent .element by default at here.

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

No branches or pull requests

2 participants