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

Conflict with babel-plugin-styled-components #42

Open
comerc opened this issue Jun 16, 2019 · 2 comments
Open

Conflict with babel-plugin-styled-components #42

comerc opened this issue Jun 16, 2019 · 2 comments

Comments

@comerc
Copy link

comerc commented Jun 16, 2019

I try to use @reshadow/styled in CRA.

I forgot to exclude babel-plugin-styled-components.

I have error:
_reshadow_styled__WEBPACK_IMPORTED_MODULE_6___default(...)(...).withConfig is not a function

@comerc
Copy link
Author

comerc commented Jun 16, 2019

And I want to analog of this plugin functionality.

@lttb
Copy link
Member

lttb commented Jun 18, 2019

Hi @comerc, thank you for the issue.

The problem is that babel-plugin-styled-components still processes the styled function, despite the fact that it was not imported from styled-components.

We should make it clear in the docs, that it needs to exclude this plugin.

About the plugin functionality:

  • SSR

    reshadow works with SSR out of the box, but it is WIP, and there are some things to improve.
    And it looks like that this option is required for the rehydration which we currently don't support

  • Display Names

    I think that would be nice to support for @reshadow/styled too.

    By the way, reshadow itself does not have this problem by design

  • Minification, pure comment comments and template strings transpiling are also cool things to support, but I'm not sure that we are missing a lot at this moment without them

An important thing, that reshadow supports the css prop without babel.

I'll try too look at this week in case of reshadow compatibility with babel-plugin-styled-components, and maybe we can make some things work out of the box, but it would be better to implement the same functionality without depending on the styled-components internals

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