You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
whmountains
changed the title
renderStylesToString returns empty style tags.
renderStylesToString doesn't work with custom emotion instances.
Mar 19, 2018
emotion
version: 9.0.2react
version: 16.2.0I'm using react-static.
My React component:
Server rendering code:
console.log(html)
prints this: (redacted to just show the important part)The style tag is empty. Not good.
To further debug this, I looked at emotion's context object:
Notice that
inserted.aoqeef-Title
is an empty string. Something tells me it should contain css. https://github.com/emotion-js/emotion/blob/master/packages/create-emotion-server/src/inline.js#L18 seems to confirm this.So where is the empty string coming from? I believe it comes from here: https://github.com/emotion-js/emotion/blob/master/packages/create-emotion/src/index.js#L249-L262
This snippet in particular seems to be the culprit:
I was able to make everything work by re-writing it this way:
I'm not familiar with emotion's internals, so this may just be a symtom of a mis-configuration on my part.
The text was updated successfully, but these errors were encountered: