title: Typescript styled-component error: "Type '{ children: string; }' has no properties in common with type 'IntrinsicAttributes'."
body: <p>Getting a typescript error on my styled-component</p>
  
  <blockquote>
    <p>Type '{ children: string; }' has no properties in common with type 'IntrinsicAttributes'.ts(2559)</p>
  </blockquote>
  
  <pre><code>import React from 'react'
  
  import { NotificationSuccess, NotificationError } from '../../styles'
  
  interface IProps {
    error?: boolean;
    message: string;
  }
  
  export const Notification = (props: IProps) =&gt; {
    const Note = () =&gt; props.error ? NotificationError : NotificationSuccess;
    // Error happens on &lt;Note&gt;
    return (&lt;Note&gt;{props.message}&lt;/Note&gt;);
  }
  </code></pre>
  
  <p>And the styles:</p>
  
  <pre><code>import styled from 'styled-components';
  
  export const NotificationDiv = styled.div`
    z-index: 11;
    position: fixed;
    left: 50%;
    margin-left: -160px;
    top: 1rem;
    padding: 1.5rem;
    width: 320px;
    height: auto;
    text-align: center;
    color: ${props =&gt; props.theme.offWhite};
    border-radius: 5px;
    cursor: pointer;
  `
  
  export const NotificationSuccess = styled(NotificationDiv)`
    background: ${props =&gt; props.theme.green};
  `
  
  export const NotificationError = styled(NotificationDiv)`
    background: ${props =&gt; props.theme.red};
  `
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/PyVr8.png" rel="noreferrer"><img src="https://i.stack.imgur.com/PyVr8.png" alt="enter image description here"></a></p>
  
  <p>I found this answer here, and I did upgrade my package.json to the following, but that still didn't help:</p>
  
  <p><a href="https://stackoverflow.com/questions/53724583/why-this-wrapped-styled-component-errors-has-no-properties-in-common-with/53902817#53902817">Why this wrapped styled-component errors &quot;has no properties in common with&quot;</a></p>
  
  <pre><code>"styled-components": "4.0.3",
  "@types/styled-components": "4.0.3",
  "babel-plugin-styled-components": "^1.10.0",
  </code></pre>
  
  <p>Full package.json</p>
  
  <pre><code>{
    "name": "",
    "version": "2.0.0",
    "main": "index.js",
    "scripts": {
      "dev": "next -p 7777",
      "build": "next build",
      "start": "next start -p 8000",
      "test": "NODE_ENV=test jest --watch --no-cache",
      "test-win": "SET NODE_ENV=test&amp;&amp; jest --watch"
    },
    "license": "ISC",
    "dependencies": {
      "@zeit/next-sass": "^1.0.1",
      "@zeit/next-typescript": "^1.1.1",
      "axios": "^0.18.0",
      "decko": "^1.2.0",
      "downshift": "^2.2.3",
      "enzyme": "^3.6.0",
      "enzyme-adapter-react-16": "^1.5.0",
      "graphql": "^14.0.2",
      "graphql-tag": "^2.9.2",
      "graphql-tools": "^4.0.0",
      "lodash.debounce": "^4.0.8",
      "next": "^7.0.2",
      "next-routes": "^1.4.2",
      "node-sass": "^4.11.0",
      "nprogress": "^0.2.0",
      "prop-types": "^15.6.2",
      "ramda": "^0.26.1",
      "react": "^16.7.0",
      "react-adopt": "^0.6.0",
      "react-dom": "^16.7.0",
      "react-redux": "^6.0.0",
      "react-transition-group": "^2.5.0",
      "redux-devtools-extension": "^2.13.8",
      "redux-thunk": "^2.3.0",
      "styled-components": "4.0.3",
      "tslint": "^5.12.1",
      "tslint-react": "^3.6.0",
      "typescript": "^3.2.4",
      "waait": "^1.0.2"
    },
    "devDependencies": {
      "@babel/plugin-proposal-decorators": "^7.3.0",
      "@babel/preset-typescript": "^7.1.0",
      "@types/enzyme": "^3.1.15",
      "@types/jest": "^23.3.13",
      "@types/next": "^7.0.6",
      "@types/ramda": "^0.25.49",
      "@types/react": "^16.7.20",
      "@types/react-dom": "^16.0.11",
      "@types/react-redux": "^7.0.1",
      "@types/styled-components": "4.0.3",
      "@types/zeit__next-typescript": "^0.1.1",
      "babel-core": "^7.0.0-bridge.0",
      "babel-jest": "^24.1.0",
      "babel-plugin-sass-vars": "^0.2.1",
      "babel-plugin-styled-components": "^1.10.0",
      "casual": "^1.5.19",
      "enzyme-to-json": "^3.3.4",
      "jest": "^24.1.0"
    },
    "jest": {
      "setupTestFrameworkScriptFile": "&lt;rootDir&gt;/jest.setup.js",
      "testPathIgnorePatterns": [
        "&lt;rootDir&gt;/.next/",
        "&lt;rootDir&gt;/node_modules/"
      ],
      "transform": {
        ".*": "babel-jest",
        "^.+\\.js?$": "babel-jest",
        "^.+\\.ts?$": "babel-jest",
        "^.+\\.tsx?$": "babel-jest"
      },
      "moduleFileExtensions": [
        "js",
        "json",
        "ts",
        "tsx"
      ],
      "modulePaths": [
        "&lt;rootDir&gt;/components/",
        "&lt;rootDir&gt;/pages/",
        "&lt;rootDir&gt;/shared/"
      ]
    }
  }
  
  </code></pre>