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

OakImage has "fullscreen" styles before JS, causing large flash of images #237

Open
remy opened this issue Jul 19, 2024 · 6 comments
Open

Comments

@remy
Copy link

remy commented Jul 19, 2024

Zip to replicate with reduced case:
component-image-issue.zip

Screenshot of issue in production (on OpenAPI):

350135325-340440a5-e4dd-4ed8-9fe8-5c03bc3fd2e3

Problem stems from these properties, but the wrapping div doesn't have a style prop (position: relative) which would fix it (but it is in the class, but this relies on JS to render first):

SCR-20240719-liro
@kimon-satan
Copy link
Collaborator

I don't understand why we aren't getting the same issue on OWA . Could it be that we have something set up differently ?

@remy
Copy link
Author

remy commented Jul 19, 2024

I don't think OWA is fully using the componets - but rather a hybrid. Certainly those styles aren't being applied:

SCR-20240719-lmem

@carlmw
Copy link
Contributor

carlmw commented Jul 19, 2024

I think i've found the issue. In your example you've got StyledComponentsRegistry which is an implementation for app router, but you've also got a pages router implementation inside _document.tsx.

I removed StyledComponentsRegistry entirely and all seems to work as expected.

I reckon that is scooping up all the styles before they reach _document.tsx

app router vs pages cause so much confusion.

@remy
Copy link
Author

remy commented Jul 19, 2024

SCR-20240719-qmke

Local test with both _document and _app instance of the StyledComponentsRegistry removed (which was helping with conflicts between server classes and client classes being differnt).

Definitely agree on app vs. pages causing confusion - the component lib definitely leans towards app router (though I know there was that recent PR to update the docs)

@carlmw
Copy link
Contributor

carlmw commented Jul 22, 2024

@remy you still need the logic in _document but not the one in _app https://github.com/oaknational/oak-openapi/pull/23

@remy
Copy link
Author

remy commented Jul 22, 2024 via email

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

3 participants