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

Use with babel-plugin-styled-components when ssr is enabled #17

Open
nathanspecht opened this issue Oct 25, 2017 · 1 comment
Open

Use with babel-plugin-styled-components when ssr is enabled #17

nathanspecht opened this issue Oct 25, 2017 · 1 comment
Labels

Comments

@nathanspecht
Copy link

nathanspecht commented Oct 25, 2017

I've noticed that babel-plugin-styled-components does not recognize styled components written without template literals, e.g.

styled('button')([], space)

rather than

styled('button')`${space}`

In my case, components generated with lab are not given componentIds when the babel plugin's ssr mode is enabled.

For this reason, would it be possible to add an option to choose which syntax is used to export components from lab?

Thank you for your work on this project.

@nathanspecht nathanspecht changed the title Use with babel-plugin-styled-components with ssr enabled Use with babel-plugin-styled-components when ssr is enabled Oct 25, 2017
@jxnblk
Copy link
Member

jxnblk commented Dec 17, 2017

Thanks for pointing this out! I'm surprised the plugin doesn't pick up components without the tagged template literal syntax. The template used for that output is now open source in lab-cli, so I imagine it would be a quick change to use the other syntax

@jxnblk jxnblk added the feature label Dec 17, 2017
johno added a commit to c8r/lab-cli that referenced this issue Jan 11, 2018
In order to support SSR, styled-components
requires string templates to be used since
that's what the babel plugin searches for.

https://github.com/styled-components/babel-plugin-styled-components/blob/master/src/index.js#L16

---

c8r/lab#17
johno added a commit to c8r/lab-cli that referenced this issue Jan 11, 2018
In order to support SSR, styled-components
requires string templates to be used since
that's what the babel plugin searches for.

https://github.com/styled-components/babel-plugin-styled-components/blob/master/src/index.js#L16

---

c8r/lab#17
johno added a commit to c8r/lab-cli that referenced this issue Jan 11, 2018
In order to support SSR, styled-components
requires string templates to be used since
that's what the babel plugin searches for.

https://github.com/styled-components/babel-plugin-styled-components/blob/master/src/index.js#L16

---

c8r/lab#17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants