styled components props typescript

C++
# to prevent typescript error, install this
yarn add @types/styled-components

# NPM
npm install @types/styled-componentsinterface YourProps {
  invalid: boolean
}

const Input = styled.input`
  border: ${(p: YourProps) => p.invalid ? 'red' : 'blue'};
`

Source

Also in C++: