Типизация пропсов в стильных компонентах

PHOTO EMBED

Mon Dec 27 2021 13:36:17 GMT+0000 (UTC)

Saved by @happy_cutman #react.js

border: ${(props: { error: boolean }) => (props.error ? '1px solid #F20D19' : '1px solid transparent')};

export const Img = styled.img<{ alt: string, src: string}>`
  margin-right: 15px;
`;
content_copyCOPY