reshadow icon indicating copy to clipboard operation
reshadow copied to clipboard

Conflict with babel-plugin-styled-components

Open comerc opened this issue 5 years ago • 2 comments

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 avatar Jun 16 '19 12:06 comerc

And I want to analog of this plugin functionality.

comerc avatar Jun 16 '19 12:06 comerc

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

lttb avatar Jun 18 '19 05:06 lttb