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

feat(JssProvider): provide custom isSSR flag #1610

Merged
merged 2 commits into from
Apr 21, 2022

Conversation

enisdenjo
Copy link
Member

Using renderToString in a browser environment is completely legal; however, in such cases, the isInBrowser check will be truthy - causing some parts to misbehave (like choosing the wrong effect, useLayoutEffect over useEffect).

This PR allows the user to supply a custom isSSR prop to the JssProvider overriding the default isInBrowser check.

Also necessary for fixing failing tests in #1609.

@kof
Copy link
Member

kof commented Apr 21, 2022

This looks great!

@kof kof merged commit c40e67c into cssinjs:master Apr 21, 2022
@enisdenjo enisdenjo deleted the jss-provider-isssr branch April 21, 2022 09:58
@kof
Copy link
Member

kof commented Apr 22, 2022

DM'd you on twitter

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