linaria icon indicating copy to clipboard operation
linaria copied to clipboard

Adding @linaria in a babel presets causing styling issues

Open Ibaslogic opened this issue 3 years ago • 0 comments

Environment

  • Linaria version: v4.1.0
  • Bundler (+ version): Webpack 5+
  • Node.js version: v18+
  • OS: macOS v12.2.1

Description

I noticed a few issues with styling whenever I include the @linaria presets in the .babelrc file:

{
  "presets": [
    "@babel/preset-env",
    "@babel/preset-react", 
    // "@linaria"
  ]
}

Issues:

  1. Dynamic prop with styled component tag stopped working
  2. Using a styled and css tag template in the same file produces an unexpected result.

Without @linaria included in the presets, the style produces the expected result, but the code has testing issues with jest.

Reproducible Demo

I created a GitHub repo for the code: https://github.com/Ibaslogic/linaria-react-test/tree/main/src

Ibaslogic avatar Aug 03 '22 16:08 Ibaslogic