Repository navigation
fix SSR issue in v2 and not in vendor - #394
Conversation
|
Not sure what's going on with the CI checks... if you can tell me what it's failing on I'll do my best to fix! |
|
This looks great! The CI is failing due to a simple linting error: (you can replicate this locally by running |
|
Okay great, removed that ! |
chiefjester
left a comment
There was a problem hiding this comment.
Looks good, just need to add a test. I hope you don't mind.
| } | ||
| getCSS({ min = true }: { min: boolean } = {}) { | ||
| return this.styleSheet.rules().map(rule => rule.cssText).join(min ? '' : '\n') | ||
| return this.styleSheet.sheet ? |
There was a problem hiding this comment.
would you mind adding a test if SSR doesn't have any styles?
|
Okay added tests! First time doing that as well, let me know if it doesn't look right. |
Generated by 🚫 dangerJS |
mxstbr
left a comment
There was a problem hiding this comment.
Looks great! One tiny comment then I think we can ship this.
| }) | ||
|
|
||
| it('should not throw an error if no styled-components are rendered', () => { | ||
| const css = styleSheet.getCSS(); |
There was a problem hiding this comment.
This is a good start, but this would be even better:
expect(() => styleSheet.getCSS()).toNotThrow()To make it very clear what this should do 😊
There was a problem hiding this comment.
Sounds good, just fixed it :)
mxstbr
left a comment
There was a problem hiding this comment.
Awesome, great work!! 🎉 thanks so much!
This is the same issue I was fixing here, but solved on the right branch and not in
/vendor.