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

Add defaultContainerWidth option for SSR rendering support #175

Merged
merged 1 commit into from
Aug 16, 2022
Merged

Add defaultContainerWidth option for SSR rendering support #175

merged 1 commit into from
Aug 16, 2022

Conversation

itoldya
Copy link
Collaborator

@itoldya itoldya commented Aug 16, 2022

Since react-grid-gallery relies on clientWidth which is available only on the client side it is not possible to render component on the server side - it always returns a wrapper without thumbnails. I added optional prop defaultContainerWidth to workaround it.

I also reformat tables in the readme. My IDE highlighted an error For compatibility reasons all table rows should have borders (pipe symbols) at the start and at the end so I decided to apply a fix.

@benhowell benhowell merged commit 343cb81 into benhowell:master Aug 16, 2022
@benhowell
Copy link
Owner

Thanks @itoldya for the SSR width prop.
I'll merge.

Is it possible to get a hint from the client side to automate the setting? I'm not too familiar with SSR (or react post version 15) so I'm pretty clueless as to what can be gathered from the client side to help automate the prop.

Thanks!

@benhowell
Copy link
Owner

Thanks for updating the readme btw ;-)

@itoldya itoldya deleted the ssr-support branch August 16, 2022 13:20
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