/ts-styled-components

Use typescript interface in styled-components

Primary LanguageTypeScriptMIT LicenseMIT

ts-styled-components

Using typescript interface in styled-components

Usage

Install

npm i ts-styled-components --save
yarn add ts-styled-components

Usage

import withProps from 'ts-styled-components'

interface IProps {
  isTest: boolean,
}

const styles = {
  containers: withProps<IProps>()(styled.view)`
    width: ${(props) => props.isTest ? '600' : '200' }px;
  `
};