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

Cypress tests fail for hydrated components #28

Open
justman00 opened this issue Dec 22, 2020 · 2 comments
Open

Cypress tests fail for hydrated components #28

justman00 opened this issue Dec 22, 2020 · 2 comments

Comments

@justman00
Copy link

Here is a reproducible repo: https://github.com/justman00/react-lazy-hydration-cypress. When running yarn e2e and selecting the only available test, observe how the tests fail. I found a workaround of how to fix them is to give display: contents; to the child container, see https://github.com/justman00/react-lazy-hydration-cypress/blob/main/components/MyLayout.js#L9. I would like to understand what would cause it to fail and why it is being fixed by another wrapper with the mentioned above styles.

@justman00
Copy link
Author

Unfortunately setting display: contents; on an inner wrapper solves the Cypress issue but breaks the functionality of the hydration, resulting in components being non-functional anymore

@ScriptedAlchemy
Copy link
Collaborator

I usually reset the prop to style={null} so it just shows a div. There's also a noWrapper prop you can add onto it to prevent it creating a wrapping element

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