astroturfcss / gatsby-plugin-astroturf

Gatsby plugin for styling with astroturf
MIT License
11 stars 2 forks source link

Usage w/ Typescript (.tsx) #4

Open thejustinwalsh opened 3 years ago

thejustinwalsh commented 3 years ago

When using the Gatsby default starter and modifying the using-typescript.tsx file to use astroturf...

import styled, { css } from "astroturf/react"

const Article = styled('article')`
  font-weight: 200;
`;

I am receiving the following error at runtime.

Uncaught Error: This styled() template tag was mistakenly evaluated at runtime.
Make sure astroturf is properly configured to compile this file


gatsby-config.js

    `gatsby-plugin-postcss`,
    {
      resolve: `gatsby-plugin-astroturf`,
      options: {
        enableDynamicInterpolations: true,
      }
    },


npm

gatsby: "2.22.15",
astroturf: "1.0.0.0-beta.17",
thejustinwalsh commented 3 years ago

Example repo here: https://github.com/thejustinwalsh/gatsby-astroturf-tailwind