trustyoo86 / ts-styled-components

Use typescript interface in styled-components

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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;
  `
};

About

Use typescript interface in styled-components

License:MIT License


Languages

Language:TypeScript 100.0%