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

Window wrapper mock #1161

Merged
merged 4 commits into from
Aug 29, 2023
Merged

Window wrapper mock #1161

merged 4 commits into from
Aug 29, 2023

Conversation

IzaacAyelin
Copy link
Collaborator

@IzaacAyelin IzaacAyelin commented Aug 27, 2023

What
we want to use a partial window mock at the first client render
Why
we want the first render to use the mock values, same values used in the SSR response to prevent hydration issues

NOTE: the mock needed to be partial because we register to the window events listener when some of our components are mounted, the mocked properties on the client are dimensions and scroll

@IzaacAyelin IzaacAyelin changed the base branch from master to V4_Final August 27, 2023 08:09
@@ -130,6 +131,7 @@ export class GalleryContainer extends React.Component {
}

componentDidMount() {
windowWrapper.isGalleryMounted = true;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrap this in a function and think of the context. isGalleryMounted is the gallery's bussiness, not a windowWrapper logic. so the windowWrapper might have a flag that says useMock(or something like this) that could change to false after the gallery calls a function.

@IzaacAyelin IzaacAyelin merged commit 747da2f into V4_Final Aug 29, 2023
7 checks passed
@IzaacAyelin IzaacAyelin deleted the visible-items branch August 29, 2023 12:18
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