Answers for "cannot find module styled component typescript"

6

styled-components error in typescript

//in styled component with param define type of param
const StyledComponent = styled.div`
        background: black;
        color: white;
    `;

    const StyledComponentWithParams = styled.div<{ color?: string }>`
        background: yellow;
        color: ${(color) => (color ? "yellow" : "white")};
    `;

    const StyledComponentDefaultValueParams = styled.div<{ color?: string }>`
        background: yellow;
        color: ${(color = "white") => (color)};
    `;
Posted by: Guest on November-05-2021
0

Error: Cannot find module 'gatsby-plugin-styled-components/package.json'

npm install gatsby-plugin-styled-components styled-components babel-plugin-styled-components

// in your gatsby-config.js

plugins: [
    {
      resolve: `gatsby-plugin-styled-components`,
      options: {
        displayName: false,
      },
    },
]
Posted by: Guest on August-17-2021

Code answers related to "cannot find module styled component typescript"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language